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
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()emitBatchNew(TransactionAttempt tx, TridentCollector collector, Set<KafkaTridentSpoutTopicPartition> partitions, Map<KafkaTridentSpoutTopicPartition, Map<String, Object>> lastPartitionMetaMap) Emit a batch of tuples for the partitions that's never been emitted before.getOrderedPartitions(List<Map<String, Object>> allPartitionInfo) Sorts given partition info to produce an ordered list of partitions.voidreEmitPartitionBatch(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.voidrefreshPartitions(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, waitMethods 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.EmitterSorts given partition info to produce an ordered list of partitions.- Specified by:
getOrderedPartitionsin 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.
-
emitBatchNew
public Map<KafkaTridentSpoutTopicPartition,Map<String, emitBatchNewObject>> (TransactionAttempt tx, TridentCollector collector, Set<KafkaTridentSpoutTopicPartition> partitions, Map<KafkaTridentSpoutTopicPartition, Map<String, Object>> lastPartitionMetaMap) Description copied from interface:IPartitionedTridentSpout.EmitterEmit a batch of tuples for the partitions that's never been emitted before. Return the metadata that can be used to reconstruct this partition/batch in the future.- Specified by:
emitBatchNewin interfaceIPartitionedTridentSpout.Emitter<List<Map<String,Object>>, KafkaTridentSpoutTopicPartition, Map<String, Object>>
-
refreshPartitions
Description copied from interface:IPartitionedTridentSpout.EmitterThis 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:
refreshPartitionsin interfaceIPartitionedTridentSpout.Emitter<List<Map<String,Object>>, KafkaTridentSpoutTopicPartition, Map<String, Object>>
-
reEmitPartitionBatch
public void reEmitPartitionBatch(TransactionAttempt tx, TridentCollector collector, KafkaTridentSpoutTopicPartition partition, Map<String, Object> partitionMeta) Description copied from interface:IPartitionedTridentSpout.EmitterEmit a batch of tuples for a partition/transaction that has been emitted before, using the metadata created when it was first emitted.- Specified by:
reEmitPartitionBatchin interfaceIPartitionedTridentSpout.Emitter<List<Map<String,Object>>, KafkaTridentSpoutTopicPartition, Map<String, Object>>
-
close
public void close()- Specified by:
closein interfaceIPartitionedTridentSpout.Emitter<List<Map<String,Object>>, KafkaTridentSpoutTopicPartition, Map<String, Object>>
-