Search in sources :

Example 1 with BatchHelper

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);
}
Also used : BatchHelper(org.apache.storm.utils.BatchHelper)

Example 2 with BatchHelper

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();
}
Also used : BatchHelper(org.apache.storm.utils.BatchHelper)

Example 3 with BatchHelper

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);
}
Also used : BatchHelper(org.apache.storm.utils.BatchHelper)

Example 4 with BatchHelper

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();
}
Also used : BatchHelper(org.apache.storm.utils.BatchHelper)

Example 5 with BatchHelper

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<>();
}
Also used : DefaultMQProducer(org.apache.rocketmq.client.producer.DefaultMQProducer) MQClientException(org.apache.rocketmq.client.exception.MQClientException) BatchHelper(org.apache.storm.utils.BatchHelper)

Aggregations

BatchHelper (org.apache.storm.utils.BatchHelper)9 ThreadFactoryBuilder (com.google.common.util.concurrent.ThreadFactoryBuilder)2 IOException (java.io.IOException)2 Timer (java.util.Timer)2 HiveUtils (org.apache.storm.hive.common.HiveUtils)2 HiveWriter (org.apache.storm.hive.common.HiveWriter)2 HiveEndPoint (org.apache.hive.hcatalog.streaming.HiveEndPoint)1 StreamingException (org.apache.hive.hcatalog.streaming.StreamingException)1 MQClientException (org.apache.rocketmq.client.exception.MQClientException)1 DefaultMQProducer (org.apache.rocketmq.client.producer.DefaultMQProducer)1