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 Details

    • emitPartitionBatch

      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.

    • refreshPartitions

      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.
      Parameters:
      partitionResponsibilities - The partitions assigned to this task
    • getOrderedPartitions

      List<PartitionT> getOrderedPartitions(PartitionsT allPartitionInfo)
      Sorts 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.
    • getPartitionsForTask

      default 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
    • close

      void close()