Class KafkaTridentTransactionalSpoutEmitter<K,V>
java.lang.Object
org.apache.storm.kafka.spout.trident.KafkaTridentTransactionalSpoutEmitter<K,V>
- All Implemented Interfaces:
Serializable
,IPartitionedTridentSpout.Emitter<List<Map<String,
Object>>, KafkaTridentSpoutTopicPartition, Map<String, Object>>
public class KafkaTridentTransactionalSpoutEmitter<K,V>
extends Object
implements IPartitionedTridentSpout.Emitter<List<Map<String,Object>>,KafkaTridentSpoutTopicPartition,Map<String,Object>>, Serializable
- See Also:
-
Constructor Summary
ConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
emitPartitionBatch
(TransactionAttempt tx, TridentCollector collector, KafkaTridentSpoutTopicPartition partition, Map<String, Object> partitionMeta) Emit a batch of tuples for a partition/transaction that has been emitted before, using the metadata created when it was first emitted.emitPartitionBatchNew
(TransactionAttempt tx, TridentCollector collector, KafkaTridentSpoutTopicPartition partition, Map<String, Object> lastPartitionMeta) Emit a batch of tuples for a partition/transaction that's never been emitted before.getOrderedPartitions
(List<Map<String, Object>> allPartitionInfo) Sorts given partition info to produce an ordered list of partitions.void
refreshPartitions
(List<KafkaTridentSpoutTopicPartition> partitionResponsibilities) This method is called when this task is responsible for a new set of partitions.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.storm.trident.spout.IPartitionedTridentSpout.Emitter
getPartitionsForTask
-
Constructor Details
-
KafkaTridentTransactionalSpoutEmitter
-
-
Method Details
-
getOrderedPartitions
public List<KafkaTridentSpoutTopicPartition> getOrderedPartitions(List<Map<String, Object>> allPartitionInfo) Description copied from interface:IPartitionedTridentSpout.Emitter
Sorts given partition info to produce an ordered list of partitions.- Specified by:
getOrderedPartitions
in interfaceIPartitionedTridentSpout.Emitter<List<Map<String,
Object>>, KafkaTridentSpoutTopicPartition, Map<String, Object>> - Parameters:
allPartitionInfo
- The partition info for all partitions being processed by all spout tasks- Returns:
- sorted list of partitions being processed by all the tasks. The ordering must be consistent for all tasks.
-
emitPartitionBatchNew
public Map<String,Object> emitPartitionBatchNew(TransactionAttempt tx, TridentCollector collector, KafkaTridentSpoutTopicPartition partition, Map<String, Object> lastPartitionMeta) Description copied from interface:IPartitionedTridentSpout.Emitter
Emit a batch of tuples for a partition/transaction that's never been emitted before. Return the metadata that can be used to reconstruct this partition/batch in the future.- Specified by:
emitPartitionBatchNew
in interfaceIPartitionedTridentSpout.Emitter<List<Map<String,
Object>>, KafkaTridentSpoutTopicPartition, Map<String, Object>>
-
refreshPartitions
Description copied from interface:IPartitionedTridentSpout.Emitter
This method is called when this task is responsible for a new set of partitions. Should be used to manage things like connections to brokers.- Specified by:
refreshPartitions
in interfaceIPartitionedTridentSpout.Emitter<List<Map<String,
Object>>, KafkaTridentSpoutTopicPartition, Map<String, Object>>
-
emitPartitionBatch
public void emitPartitionBatch(TransactionAttempt tx, TridentCollector collector, KafkaTridentSpoutTopicPartition partition, Map<String, Object> partitionMeta) Description copied from interface:IPartitionedTridentSpout.Emitter
Emit a batch of tuples for a partition/transaction that has been emitted before, using the metadata created when it was first emitted.- Specified by:
emitPartitionBatch
in interfaceIPartitionedTridentSpout.Emitter<List<Map<String,
Object>>, KafkaTridentSpoutTopicPartition, Map<String, Object>>
-
close
public void close()- Specified by:
close
in interfaceIPartitionedTridentSpout.Emitter<List<Map<String,
Object>>, KafkaTridentSpoutTopicPartition, Map<String, Object>>
-