Search in sources :

Example 1 with TestIndexSpout

use of com.alibaba.jstorm.elasticsearch.index.TestIndexSpout in project jstorm by alibaba.

the class TestSuite method testIndex.

@Test
public void testIndex() {
    TopologyBuilder builder = new TopologyBuilder();
    builder.setSpout("index-spout", new TestIndexSpout());
    EsIndexBolt esIndexBolt = new EsIndexBolt(esConfig, new EsDefaultIndexMapper());
    builder.setBolt("index-bolt", esIndexBolt).shuffleGrouping("index-spout");
    cluster.submitTopology("Index-Test", conf, builder.createTopology());
}
Also used : EsIndexBolt(com.alibaba.jstorm.elasticsearch.bolt.EsIndexBolt) TestIndexSpout(com.alibaba.jstorm.elasticsearch.index.TestIndexSpout) TopologyBuilder(backtype.storm.topology.TopologyBuilder) EsDefaultIndexMapper(com.alibaba.jstorm.elasticsearch.mapper.EsDefaultIndexMapper) Test(org.junit.Test)

Example 2 with TestIndexSpout

use of com.alibaba.jstorm.elasticsearch.index.TestIndexSpout in project jstorm by alibaba.

the class TestSuite method testUserDefine.

@Test
public void testUserDefine() {
    TopologyBuilder builder = new TopologyBuilder();
    builder.setSpout("user-define-spout", new TestIndexSpout());
    TestIndexBolt esIndexBolt = new TestIndexBolt(esConfig);
    builder.setBolt("user-define-bolt", esIndexBolt).shuffleGrouping("user-define-spout");
    cluster.submitTopology("UserDefine-Test", conf, builder.createTopology());
}
Also used : TestIndexSpout(com.alibaba.jstorm.elasticsearch.index.TestIndexSpout) TopologyBuilder(backtype.storm.topology.TopologyBuilder) TestIndexBolt(com.alibaba.jstorm.elasticsearch.userdefine.TestIndexBolt) Test(org.junit.Test)

Aggregations

TopologyBuilder (backtype.storm.topology.TopologyBuilder)2 TestIndexSpout (com.alibaba.jstorm.elasticsearch.index.TestIndexSpout)2 Test (org.junit.Test)2 EsIndexBolt (com.alibaba.jstorm.elasticsearch.bolt.EsIndexBolt)1 EsDefaultIndexMapper (com.alibaba.jstorm.elasticsearch.mapper.EsDefaultIndexMapper)1 TestIndexBolt (com.alibaba.jstorm.elasticsearch.userdefine.TestIndexBolt)1