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 and Description
    --- | ---
    `static long` | `TIMER_DELAY_MS`

  - ### Constructor Summary

    Constructors
    Constructor and 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 and 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<List<Map<String,Object>>>`
      Specified by:
        `isReady` in interface `IPartitionedTridentSpout.Coordinator<List<Map<String,Object>>>`
      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<List<Map<String,Object>>>`
      Specified by:
        `getPartitionsForBatch` in interface `IPartitionedTridentSpout.Coordinator<List<Map<String,Object>>>`
      Returns:
        The partitions for the following batches.

    - #### close

          public void close()

      Specified by:
        `close` in interface `IOpaquePartitionedTridentSpout.Coordinator<List<Map<String,Object>>>`
      Specified by:
        `close` in interface `IPartitionedTridentSpout.Coordinator<List<Map<String,Object>>>`

    - #### toString

          public final String toString()

      Overrides:
        `toString` in class `Object`

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