org.apache.storm.eventhubs.trident

## Class OpaqueTridentEventHubEmitter

- java.lang.Object
- - org.apache.storm.eventhubs.trident.OpaqueTridentEventHubEmitter

- All Implemented Interfaces:
    IOpaquePartitionedTridentSpout.Emitter<Partitions,Partition,Map>

      public class OpaqueTridentEventHubEmitter
      extends Object
      implements IOpaquePartitionedTridentSpout.Emitter<Partitions,Partition,Map>

  A thin wrapper of TransactionalTridentEventHubEmitter for OpaqueTridentEventHubSpout.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `OpaqueTridentEventHubEmitter(EventHubSpoutConfig spoutConfig)`
    `OpaqueTridentEventHubEmitter(EventHubSpoutConfig spoutConfig, int batchSize, ITridentPartitionManagerFactory pmFactory, IEventHubReceiverFactory recvFactory)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `Map` | `emitPartitionBatch(TransactionAttempt attempt, TridentCollector collector, Partition partition, Map meta)` Emit a batch of tuples for a partition/transaction.
    `List<Partition>` | `getOrderedPartitions(Partitions partitions)` Sorts the partition info to produce an ordered list of partition.
    `void` | `refreshPartitions(List<Partition> partitionList)` 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.IOpaquePartitionedTridentSpout.Emitter

      `getPartitionsForTask`

- - ### Constructor Detail

    - #### OpaqueTridentEventHubEmitter

          public OpaqueTridentEventHubEmitter(EventHubSpoutConfig spoutConfig)

    - #### OpaqueTridentEventHubEmitter

          public OpaqueTridentEventHubEmitter(EventHubSpoutConfig spoutConfig,
                                              int batchSize,
                                              ITridentPartitionManagerFactory pmFactory,
                                              IEventHubReceiverFactory recvFactory)

  - ### Method Detail

    - #### close

          public void close()

      Specified by:
        `close` in interface `IOpaquePartitionedTridentSpout.Emitter<Partitions,Partition,Map>`

    - #### emitPartitionBatch

          public Map emitPartitionBatch(TransactionAttempt attempt,
                                        TridentCollector collector,
                                        Partition partition,
                                        Map meta)

      Description copied from interface: `IOpaquePartitionedTridentSpout.Emitter`

      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.

      Specified by:
        `emitPartitionBatch` in interface `IOpaquePartitionedTridentSpout.Emitter<Partitions,Partition,Map>`

    - #### getOrderedPartitions

          public List<Partition> getOrderedPartitions(Partitions partitions)

      Description copied from interface: `IOpaquePartitionedTridentSpout.Emitter`

      Sorts the partition info to produce an ordered list of partition.

      Specified by:
        `getOrderedPartitions` in interface `IOpaquePartitionedTridentSpout.Emitter<Partitions,Partition,Map>`
      Parameters:
        `partitions` - 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.

    - #### refreshPartitions

          public void refreshPartitions(List<Partition> partitionList)

      Description copied from interface: `IOpaquePartitionedTridentSpout.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 `IOpaquePartitionedTridentSpout.Emitter<Partitions,Partition,Map>`
      Parameters:
        `partitionList` - The partitions assigned to this task

Copyright © 2021 The Apache Software Foundation. All rights reserved.