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

## Class KafkaTridentSpoutCoordinator<K,​V>

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

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

      public class KafkaTridentSpoutCoordinator<K,​V>
      extends Object
      implements IOpaquePartitionedTridentSpout.Coordinator<List<Map<String,​Object>>>, IPartitionedTridentSpout.Coordinator<List<Map<String,​Object>>>, Serializable

  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static long` | `TIMER_DELAY_MS` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `KafkaTridentSpoutCoordinator​(KafkaTridentSpoutConfig<K,​V> kafkaSpoutConfig)` | Creates a new coordinator based on the given spout config.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `close()` |
    `List<Map<String,​Object>>` | `getPartitionsForBatch()` | Gets the partitions for the following batches.
    `boolean` | `isReady​(long txid)` | Indicates whether this coordinator is ready to commit the given transaction.
    `String` | `toString()` |

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

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

- - ### Field Detail

    - #### TIMER_DELAY_MS

          public static final long TIMER_DELAY_MS

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### KafkaTridentSpoutCoordinator

          public KafkaTridentSpoutCoordinator​(KafkaTridentSpoutConfig<K,​V> kafkaSpoutConfig)

      Creates a new coordinator based on the given spout config.
      Parameters:
        `kafkaSpoutConfig` - The spout config to use

  - ### Method Detail

    - #### isReady

          public boolean isReady​(long txid)

      Description copied from interface: `IOpaquePartitionedTridentSpout.Coordinator`
      Indicates whether this coordinator is ready to commit the given transaction. The master batch coordinator will only begin committing if at least one coordinator indicates it is ready to commit.
      Specified by:
        `isReady` in interface `IOpaquePartitionedTridentSpout.Coordinator<K>`
      Specified by:
        `isReady` in interface `IPartitionedTridentSpout.Coordinator<K>`
      Parameters:
        `txid` - The transaction id
      Returns:
        true if this coordinator is ready to commit, false otherwise.

    - #### getPartitionsForBatch

          public List<Map<String,​Object>> getPartitionsForBatch()

      Description copied from interface: `IOpaquePartitionedTridentSpout.Coordinator`
      Gets the partitions for the following batches. The emitter will be asked to refresh partitions when this value changes.
      Specified by:
        `getPartitionsForBatch` in interface `IOpaquePartitionedTridentSpout.Coordinator<K>`
      Specified by:
        `getPartitionsForBatch` in interface `IPartitionedTridentSpout.Coordinator<K>`
      Returns:
        The partitions for the following batches.

    - #### close

          public void close()

      Specified by:
        `close` in interface `IOpaquePartitionedTridentSpout.Coordinator<K>`
      Specified by:
        `close` in interface `IPartitionedTridentSpout.Coordinator<K>`

    - #### toString

          public final String toString()

      Overrides:
        `toString` in class `Object`