Search in sources :

Example 1 with TestQuerySpout

use of com.alibaba.jstorm.elasticsearch.query.TestQuerySpout in project jstorm by alibaba.

the class TestSuite method testQuery.

@Test
public void testQuery() {
    TopologyBuilder builder = new TopologyBuilder();
    builder.setSpout("query-spout", new TestQuerySpout());
    EsOutputDeclarer esOutputDeclarer = new EsOutputDeclarer().addField("date");
    EsQueryBolt esIndexBolt = new EsQueryBolt(esConfig, new TestQueryMapper(), esOutputDeclarer);
    builder.setBolt("query-bolt", esIndexBolt).shuffleGrouping("query-spout");
    builder.setBolt("end-bolt", new TestQueryBolt()).shuffleGrouping("query-bolt");
    cluster.submitTopology("Query-Test", conf, builder.createTopology());
}
Also used : TestQueryBolt(com.alibaba.jstorm.elasticsearch.query.TestQueryBolt) TopologyBuilder(backtype.storm.topology.TopologyBuilder) EsQueryBolt(com.alibaba.jstorm.elasticsearch.bolt.EsQueryBolt) TestQueryMapper(com.alibaba.jstorm.elasticsearch.query.TestQueryMapper) TestQuerySpout(com.alibaba.jstorm.elasticsearch.query.TestQuerySpout) EsOutputDeclarer(com.alibaba.jstorm.elasticsearch.common.EsOutputDeclarer) Test(org.junit.Test)

Aggregations

TopologyBuilder (backtype.storm.topology.TopologyBuilder)1 EsQueryBolt (com.alibaba.jstorm.elasticsearch.bolt.EsQueryBolt)1 EsOutputDeclarer (com.alibaba.jstorm.elasticsearch.common.EsOutputDeclarer)1 TestQueryBolt (com.alibaba.jstorm.elasticsearch.query.TestQueryBolt)1 TestQueryMapper (com.alibaba.jstorm.elasticsearch.query.TestQueryMapper)1 TestQuerySpout (com.alibaba.jstorm.elasticsearch.query.TestQuerySpout)1 Test (org.junit.Test)1