public static interface IPartitionedTridentSpout.Emitter<PartitionsT,PartitionT extends ISpoutPartition,X>
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
emitPartitionBatch(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.
|
X |
emitPartitionBatchNew(TransactionAttempt tx,
TridentCollector collector,
PartitionT partition,
X lastPartitionMeta)
Emit a batch of tuples for a partition/transaction that's never been emitted before.
|
List<PartitionT> |
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.
|
void |
refreshPartitions(List<PartitionT> partitionResponsibilities)
This method is called when this task is responsible for a new set of partitions.
|
List<PartitionT> getOrderedPartitions(PartitionsT allPartitionInfo)
allPartitionInfo
- The partition info for all partitions being processed by all spout tasksX emitPartitionBatchNew(TransactionAttempt tx, TridentCollector collector, PartitionT partition, X lastPartitionMeta)
void refreshPartitions(List<PartitionT> partitionResponsibilities)
void emitPartitionBatch(TransactionAttempt tx, TridentCollector collector, PartitionT partition, X partitionMeta)
default List<PartitionT> getPartitionsForTask(int taskId, int numTasks, List<PartitionT> allPartitionInfoSorted)
taskId
- The id of the tasknumTasks
- The number of tasks for the spoutallPartitionInfoSorted
- The partition info of all partitions being processed by all spout tasks, sorted according to
getOrderedPartitions(java.lang.Object)
taskId
void close()
Copyright © 2023 The Apache Software Foundation. All rights reserved.