Package org.apache.storm.trident.spout
Interface IOpaquePartitionedTridentSpout.Emitter<PartitionsT,PartitionT extends ISpoutPartition,M>  
- All Known Implementing Classes:
- KafkaTridentOpaqueSpoutEmitter
- Enclosing interface:
- IOpaquePartitionedTridentSpout<PartitionsT,PartitionT extends ISpoutPartition, M> 
public static interface IOpaquePartitionedTridentSpout.Emitter<PartitionsT,PartitionT extends ISpoutPartition,M>  
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()emitBatchNew(TransactionAttempt tx, TridentCollector collector, Set<PartitionT> partitions, Map<PartitionT, M> lastBatchMetaMap) Emit a batch of tuples for a list of partitions/transactions.getOrderedPartitions(PartitionsT allPartitionInfo) Sorts the partition info to produce an ordered list of partition.default List<PartitionT>getPartitionsForTask(int taskId, int numTasks, List<PartitionT> allPartitionInfoSorted) Get the partitions assigned to this task.voidrefreshPartitions(List<PartitionT> partitionResponsibilities) This method is called when this task is responsible for a new set of partitions.
- 
Method Details- 
emitBatchNewMap<PartitionT,M> emitBatchNew(TransactionAttempt tx, TridentCollector collector, Set<PartitionT> partitions, Map<PartitionT, M> lastBatchMetaMap) Emit a batch of tuples for a list of partitions/transactions.Return the map of metadata describing this batch that will be used as lastPartitionMeta for defining the parameters of the next batch for each partition. 
- 
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.- Parameters:
- partitionResponsibilities- The partitions assigned to this task
 
- 
getOrderedPartitionsSorts the partition info to produce an ordered list of partition.- Parameters:
- allPartitionInfo- The partition info for all partitions being processed by all spout tasks
- Returns:
- The ordered list of partitions being processed by all the tasks. The ordering must be consistent for all tasks.
 
- 
getPartitionsForTaskdefault List<PartitionT> getPartitionsForTask(int taskId, int numTasks, List<PartitionT> allPartitionInfoSorted) Get the partitions assigned to this task.- Parameters:
- taskId- The id of this task
- numTasks- The number of tasks for this spout
- allPartitionInfoSorted- The partition info for 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 id taskId
 
- 
closevoid close()
 
-