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

## Class KafkaTridentTransactionalSpoutEmitter<K,​V>

- java.lang.Object
- - org.apache.storm.kafka.spout.trident.KafkaTridentTransactionalSpoutEmitter<K,​V>

- All Implemented Interfaces:
    `Serializable`, `IPartitionedTridentSpout.Emitter<List<Map<String,​Object>>,​KafkaTridentSpoutTopicPartition,​Map<String,​Object>>`

      public class KafkaTridentTransactionalSpoutEmitter<K,​V>
      extends Object
      implements IPartitionedTridentSpout.Emitter<List<Map<String,​Object>>,​KafkaTridentSpoutTopicPartition,​Map<String,​Object>>, Serializable

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `KafkaTridentTransactionalSpoutEmitter​(KafkaTridentSpoutEmitter<K,​V> emitter)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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>> lastPartitionMetaMap)` | Emit a batch of tuples for the partitions that's never been emitted before.
    `List<KafkaTridentSpoutTopicPartition>` | `getOrderedPartitions​(List<Map<String,​Object>> allPartitionInfo)` | Sorts given partition info to produce an ordered list of partitions.
    `void` | `reEmitPartitionBatch​(TransactionAttempt tx, TridentCollector collector, KafkaTridentSpoutTopicPartition partition, Map<String,​Object> partitionMeta)` | Emit a batch of tuples for a partition/transaction that has been emitted before, using the metadata created when it was first emitted.
    `void` | `refreshPartitions​(List<KafkaTridentSpoutTopicPartition> partitionResponsibilities)` | This method is called when this task is responsible for a new set of partitions.

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

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

    - ### Methods inherited from interface org.apache.storm.trident.spout.IPartitionedTridentSpout.Emitter

      `getPartitionsForTask`

- - ### Constructor Detail

    - #### KafkaTridentTransactionalSpoutEmitter

          public KafkaTridentTransactionalSpoutEmitter​(KafkaTridentSpoutEmitter<K,​V> emitter)

  - ### Method Detail

    - #### getOrderedPartitions

          public List<KafkaTridentSpoutTopicPartition> getOrderedPartitions​(List<Map<String,​Object>> allPartitionInfo)

      Description copied from interface: `IPartitionedTridentSpout.Emitter`
      Sorts given partition info to produce an ordered list of partitions.
      Specified by:
        `getOrderedPartitions` in interface `IPartitionedTridentSpout.Emitter<List<Map<String,​Object>>,​KafkaTridentSpoutTopicPartition,​Map<String,​Object>>`
      Parameters:
        `allPartitionInfo` - The partition info for all partitions being processed by all spout tasks
      Returns:
        sorted list of partitions being processed by all the tasks. The ordering must be consistent for all tasks.

    - #### emitBatchNew

          public Map<KafkaTridentSpoutTopicPartition,​Map<String,​Object>> emitBatchNew​(TransactionAttempt tx,
                                                                                                  TridentCollector collector,
                                                                                                  Set<KafkaTridentSpoutTopicPartition> partitions,
                                                                                                  Map<KafkaTridentSpoutTopicPartition,​Map<String,​Object>> lastPartitionMetaMap)

      Description copied from interface: `IPartitionedTridentSpout.Emitter`
      Emit a batch of tuples for the partitions that's never been emitted before. Return the metadata that can be used to reconstruct this partition/batch in the future.
      Specified by:
        `emitBatchNew` in interface `IPartitionedTridentSpout.Emitter<List<Map<String,​Object>>,​KafkaTridentSpoutTopicPartition,​Map<String,​Object>>`

    - #### refreshPartitions

          public void refreshPartitions​(List<KafkaTridentSpoutTopicPartition> partitionResponsibilities)

      Description copied from interface: `IPartitionedTridentSpout.Emitter`
      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.
      Specified by:
        `refreshPartitions` in interface `IPartitionedTridentSpout.Emitter<List<Map<String,​Object>>,​KafkaTridentSpoutTopicPartition,​Map<String,​Object>>`

    - #### reEmitPartitionBatch

          public void reEmitPartitionBatch​(TransactionAttempt tx,
                                           TridentCollector collector,
                                           KafkaTridentSpoutTopicPartition partition,
                                           Map<String,​Object> partitionMeta)

      Description copied from interface: `IPartitionedTridentSpout.Emitter`
      Emit a batch of tuples for a partition/transaction that has been emitted before, using the metadata created when it was first emitted.
      Specified by:
        `reEmitPartitionBatch` in interface `IPartitionedTridentSpout.Emitter<List<Map<String,​Object>>,​KafkaTridentSpoutTopicPartition,​Map<String,​Object>>`

    - #### close

          public void close()

      Specified by:
        `close` in interface `IPartitionedTridentSpout.Emitter<List<Map<String,​Object>>,​KafkaTridentSpoutTopicPartition,​Map<String,​Object>>`