Package org.apache.storm.trident.spout
Interface IPartitionedTridentSpout.Emitter<PartitionsT,PartitionT extends ISpoutPartition,X>  
- All Known Implementing Classes:
- KafkaTridentTransactionalSpoutEmitter
- Enclosing interface:
- IPartitionedTridentSpout<PartitionsT,PartitionT extends ISpoutPartition, T> 
public static interface IPartitionedTridentSpout.Emitter<PartitionsT,PartitionT extends ISpoutPartition,X>  
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()emitBatchNew(TransactionAttempt tx, TridentCollector collector, Set<PartitionT> partitions, Map<PartitionT, X> lastPartitionMetaMap) Emit a batch of tuples for the partitions that's never been emitted before.getOrderedPartitions(PartitionsT allPartitionInfo) Sorts given partition info to produce an ordered list of partitions.default List<PartitionT>getPartitionsForTask(int taskId, int numTasks, List<PartitionT> allPartitionInfoSorted) Get the partitions assigned to the given task.voidreEmitPartitionBatch(TransactionAttempt tx, TridentCollector collector, PartitionT partition, X 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<PartitionT> partitionResponsibilities) This method is called when this task is responsible for a new set of partitions.
- 
Method Details- 
getOrderedPartitionsSorts given partition info to produce an ordered list of partitions.- 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.
 
- 
emitBatchNewMap<PartitionT,X> emitBatchNew(TransactionAttempt tx, TridentCollector collector, Set<PartitionT> partitions, Map<PartitionT, X> lastPartitionMetaMap) Emit 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.
- 
refreshPartitionsThis method is called when this task is responsible for a new set of partitions. Should be used to manage things like connections to brokers.
- 
reEmitPartitionBatchvoid reEmitPartitionBatch(TransactionAttempt tx, TridentCollector collector, PartitionT partition, X partitionMeta) Emit a batch of tuples for a partition/transaction that has been emitted before, using the metadata created when it was first emitted.
- 
getPartitionsForTaskdefault List<PartitionT> getPartitionsForTask(int taskId, int numTasks, List<PartitionT> allPartitionInfoSorted) Get the partitions assigned to the given task.- Parameters:
- taskId- The id of the task
- numTasks- The number of tasks for the spout
- allPartitionInfoSorted- The partition info of all partitions being processed by all spout tasks, sorted according to- getOrderedPartitions(java.lang.Object)
- Returns:
- The list of partitions that are to be processed by the task with taskId
 
- 
closevoid close()
 
-