public static interface IOpaquePartitionedTridentSpout.Emitter<PartitionsT,PartitionT extends ISpoutPartition,M>
Modifier and Type | Method and Description |
---|---|
void |
close() |
M |
emitPartitionBatch(TransactionAttempt tx,
TridentCollector collector,
PartitionT partition,
M lastPartitionMeta)
Emit a batch of tuples for a partition/transaction.
|
List<PartitionT> |
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.
|
void |
refreshPartitions(List<PartitionT> partitionResponsibilities)
This method is called when this task is responsible for a new set of partitions.
|
M emitPartitionBatch(TransactionAttempt tx, TridentCollector collector, PartitionT partition, M lastPartitionMeta)
Emit a batch of tuples for a partition/transaction.
Return the metadata describing this batch that will be used as lastPartitionMeta for defining the parameters of the next batch.
void refreshPartitions(List<PartitionT> partitionResponsibilities)
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.
partitionResponsibilities
- The partitions assigned to this taskList<PartitionT> getOrderedPartitions(PartitionsT allPartitionInfo)
Sorts the partition info to produce an ordered list of partition.
allPartitionInfo
- The partition info for all partitions being processed by all spout tasksdefault List<PartitionT> getPartitionsForTask(int taskId, int numTasks, List<PartitionT> allPartitionInfoSorted)
Get the partitions assigned to this task.
taskId
- The id of this tasknumTasks
- The number of tasks for this spoutallPartitionInfoSorted
- The partition info for all partitions being processed by all spout tasks, sorted according to getOrderedPartitions(java.lang.Object)
taskId
void close()
Copyright © 2022 The Apache Software Foundation. All rights reserved.