storm.kafka.bolt
Class KafkaBolt<K,V>

java.lang.Object
  extended by backtype.storm.topology.base.BaseComponent
      extended by backtype.storm.topology.base.BaseRichBolt
          extended by storm.kafka.bolt.KafkaBolt<K,V>
All Implemented Interfaces:
IBolt, IComponent, IRichBolt, Serializable

public class KafkaBolt<K,V>
extends BaseRichBolt

Bolt implementation that can send Tuple data to Kafka

It expects the producer configuration and topic in storm config under

'kafka.broker.properties' and 'topic'

respectively.

See Also:
Serialized Form

Field Summary
static String KAFKA_BROKER_PROPERTIES
           
static String TOPIC
           
 
Constructor Summary
KafkaBolt()
           
 
Method Summary
 void declareOutputFields(OutputFieldsDeclarer declarer)
           
 void execute(Tuple input)
           
 void prepare(Map stormConf, TopologyContext context, OutputCollector collector)
           
 KafkaBolt<K,V> withTopicSelector(KafkaTopicSelector selector)
           
 KafkaBolt<K,V> withTupleToKafkaMapper(TupleToKafkaMapper<K,V> mapper)
           
 
Methods inherited from class backtype.storm.topology.base.BaseRichBolt
cleanup
 
Methods inherited from class backtype.storm.topology.base.BaseComponent
getComponentConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface backtype.storm.topology.IComponent
getComponentConfiguration
 

Field Detail

TOPIC

public static final String TOPIC
See Also:
Constant Field Values

KAFKA_BROKER_PROPERTIES

public static final String KAFKA_BROKER_PROPERTIES
See Also:
Constant Field Values
Constructor Detail

KafkaBolt

public KafkaBolt()
Method Detail

withTupleToKafkaMapper

public KafkaBolt<K,V> withTupleToKafkaMapper(TupleToKafkaMapper<K,V> mapper)

withTopicSelector

public KafkaBolt<K,V> withTopicSelector(KafkaTopicSelector selector)

prepare

public void prepare(Map stormConf,
                    TopologyContext context,
                    OutputCollector collector)

execute

public void execute(Tuple input)

declareOutputFields

public void declareOutputFields(OutputFieldsDeclarer declarer)


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.