Package org.apache.storm.kafka.spout.trident

# Class KafkaTridentSpoutEmitter<K,V>

java.lang.Object
org.apache.storm.kafka.spout.trident.KafkaTridentSpoutEmitter<K,V>

All Implemented Interfaces:
  `Serializable`

public class KafkaTridentSpoutEmitter<K,V> extends Object implements Serializable

See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `KafkaTridentSpoutEmitter(KafkaTridentSpoutConfig<K,V> kafkaSpoutConfig, TopologyContext topologyContext)`
  Create a new Kafka spout emitter.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `Map<KafkaTridentSpoutTopicPartition,Map<String,Object>>`
  `emitBatchNew(TransactionAttempt tx, TridentCollector collector, Set<KafkaTridentSpoutTopicPartition> partitions, Map<KafkaTridentSpoutTopicPartition,Map<String,Object>> lastBatchMetaMap)`
  Emit a new batch.
  `List<KafkaTridentSpoutTopicPartition>`
  `getOrderedPartitions(List<Map<String,Object>> allPartitionInfo)`
  Get the input partitions in sorted order.
  `List<KafkaTridentSpoutTopicPartition>`
  `getPartitionsForTask(int taskId, int numTasks, List<KafkaTridentSpoutTopicPartition> allPartitionInfoSorted)`
  Get the partitions that should be handled by this task.
  `void`
  `reEmitPartitionBatch(TransactionAttempt tx, TridentCollector collector, KafkaTridentSpoutTopicPartition currBatchPartition, Map<String,Object> currBatch)`
  Emit a batch that has already been emitted.
  `void`
  `refreshPartitions(List<KafkaTridentSpoutTopicPartition> partitionResponsibilities)`
  Prepare the emitter to handle the input partitions.
  `final String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### KafkaTridentSpoutEmitter

    public KafkaTridentSpoutEmitter(KafkaTridentSpoutConfig<K,V> kafkaSpoutConfig, TopologyContext topologyContext)
    Create a new Kafka spout emitter.
    Parameters:
      `kafkaSpoutConfig` - The kafka spout config
      `topologyContext` - The topology context

- ## Method Details

  - ### reEmitPartitionBatch

    public void reEmitPartitionBatch(TransactionAttempt tx, TridentCollector collector, KafkaTridentSpoutTopicPartition currBatchPartition, Map<String,Object> currBatch)
    Emit a batch that has already been emitted.

  - ### emitBatchNew

    public Map<KafkaTridentSpoutTopicPartition,Map<String,Object>> emitBatchNew(TransactionAttempt tx, TridentCollector collector, Set<KafkaTridentSpoutTopicPartition> partitions, Map<KafkaTridentSpoutTopicPartition,Map<String,Object>> lastBatchMetaMap)
    Emit a new batch.

  - ### getOrderedPartitions

    public List<KafkaTridentSpoutTopicPartition> getOrderedPartitions(List<Map<String,Object>> allPartitionInfo)
    Get the input partitions in sorted order.

  - ### getPartitionsForTask

    public List<KafkaTridentSpoutTopicPartition> getPartitionsForTask(int taskId, int numTasks, List<KafkaTridentSpoutTopicPartition> allPartitionInfoSorted)
    Get the partitions that should be handled by this task.

  - ### refreshPartitions

    public void refreshPartitions(List<KafkaTridentSpoutTopicPartition> partitionResponsibilities)
    Prepare the emitter to handle the input partitions.

  - ### close

    public void close()

  - ### toString

    public final String toString()
    Overrides:
      `toString` in class `Object`