use of com.hmsonline.storm.contrib.bolt.elasticsearch.mapper.DefaultTupleMapper in project storm-elastic-search by hmsonline.
the class ElasticSearchTest method testBolt.
@Test
public void testBolt() {
TopologyBuilder builder = new TopologyBuilder();
ElasticSearchBolt bolt = new ElasticSearchBolt(new DefaultTupleMapper());
builder.setBolt("TEST_BOLT", bolt);
TopologyContext context = new MockTopologyContext(builder.createTopology());
Config config = new Config();
config.put(ElasticSearchBolt.ELASTIC_LOCAL_MODE, true);
bolt.prepare(config, context, null);
List<Object> values = new ArrayList<Object>();
values.add("testIndex");
values.add("entity");
values.add("testId");
values.add("{\"bolt\":\"lightning\"}");
Tuple tuple = new TupleImpl(context, values, 5, "test");
bolt.execute(tuple);
}
Aggregations