public class MongoInsertBolt extends AbstractMongoBolt
Basic bolt for writing to MongoDB.
Note: Each MongoInsertBolt defined in a topology is tied to a specific collection.
collector, mongoClient
Constructor and Description |
---|
MongoInsertBolt(String url,
String collectionName,
MongoMapper mapper) |
Modifier and Type | Method and Description |
---|---|
void |
declareOutputFields(OutputFieldsDeclarer declarer) |
void |
execute(Tuple tuple) |
Map<String,Object> |
getComponentConfiguration() |
void |
prepare(Map stormConf,
TopologyContext context,
OutputCollector collector) |
MongoInsertBolt |
withBatchSize(int batchSize) |
MongoInsertBolt |
withFlushIntervalSecs(int flushIntervalSecs) |
MongoInsertBolt |
withOrdered(boolean ordered) |
cleanup
public MongoInsertBolt(String url, String collectionName, MongoMapper mapper)
public void execute(Tuple tuple)
public MongoInsertBolt withBatchSize(int batchSize)
public MongoInsertBolt withOrdered(boolean ordered)
public MongoInsertBolt withFlushIntervalSecs(int flushIntervalSecs)
public Map<String,Object> getComponentConfiguration()
getComponentConfiguration
in interface IComponent
getComponentConfiguration
in class BaseComponent
public void prepare(Map stormConf, TopologyContext context, OutputCollector collector)
prepare
in interface IBolt
prepare
in class AbstractMongoBolt
public void declareOutputFields(OutputFieldsDeclarer declarer)
Copyright © 2016 The Apache Software Foundation. All Rights Reserved.