use of org.apache.storm.utils.BatchHelper in project storm by apache.
the class HBaseBolt method prepare.
@Override
public void prepare(Map map, TopologyContext topologyContext, OutputCollector collector) {
super.prepare(map, topologyContext, collector);
this.batchHelper = new BatchHelper(batchSize, collector);
}
use of org.apache.storm.utils.BatchHelper in project storm by apache.
the class OpenTsdbBolt method prepare.
@Override
public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) {
this.collector = collector;
batchHelper = new BatchHelper(batchSize, collector);
openTsdbClient = openTsdbClientBuilder.build();
}
use of org.apache.storm.utils.BatchHelper in project storm by apache.
the class MongoInsertBolt method prepare.
@Override
public void prepare(Map stormConf, TopologyContext context, OutputCollector collector) {
super.prepare(stormConf, context, collector);
this.batchHelper = new BatchHelper(batchSize, collector);
}
use of org.apache.storm.utils.BatchHelper in project storm by apache.
the class OpenTsdbBolt method prepare.
@Override
public void prepare(Map<String, Object> topoConf, TopologyContext context, OutputCollector collector) {
this.collector = collector;
batchHelper = new BatchHelper(batchSize, collector);
openTsdbClient = openTsdbClientBuilder.build();
}
use of org.apache.storm.utils.BatchHelper in project storm by apache.
the class RocketMqBolt method prepare.
@Override
public void prepare(Map<String, Object> topoConf, TopologyContext context, OutputCollector collector) {
Validate.notEmpty(properties, "Producer properties can not be empty");
Validate.notNull(selector, "TopicSelector can not be null");
Validate.notNull(mapper, "TupleToMessageMapper can not be null");
producer = new DefaultMQProducer();
producer.setInstanceName(String.valueOf(context.getThisTaskId()));
RocketMqConfig.buildProducerConfigs(properties, producer);
try {
producer.start();
} catch (MQClientException e) {
throw new RuntimeException(e);
}
this.collector = collector;
this.batchHelper = new BatchHelper(batchSize, collector);
this.messages = new LinkedList<>();
}
Aggregations