org.apache.storm.trident.testing

## Class FeederBatchSpout.FeederCoordinator

- java.lang.Object
- - org.apache.storm.trident.testing.FeederBatchSpout.FeederCoordinator

- All Implemented Interfaces:
    ITridentSpout.BatchCoordinator<Map<Integer,List<List<Object>>>>
  Enclosing class:
    FeederBatchSpout

      public class FeederBatchSpout.FeederCoordinator
      extends Object
      implements ITridentSpout.BatchCoordinator<Map<Integer,List<List<Object>>>>

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FeederCoordinator(int numPartitions)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Release any resources from this coordinator.
    `Map<Integer,List<List<Object>>>` | `initializeTransaction(long txid, Map<Integer,List<List<Object>>> prevMetadata, Map<Integer,List<List<Object>>> currMetadata)` Create metadata for this particular transaction id which has never been emitted before.
    `boolean` | `isReady(long txid)` hint to Storm if the spout is ready for the transaction id.
    `void` | `success(long txid)` This attempt committed successfully, so all state for this commit and before can be safely cleaned up.

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

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

- - ### Constructor Detail

    - #### FeederCoordinator

          public FeederCoordinator(int numPartitions)

  - ### Method Detail

    - #### initializeTransaction

          public Map<Integer,List<List<Object>>> initializeTransaction(long txid,
                                                                       Map<Integer,List<List<Object>>> prevMetadata,
                                                                       Map<Integer,List<List<Object>>> currMetadata)

      Description copied from interface: `ITridentSpout.BatchCoordinator`

      Create metadata for this particular transaction id which has never been emitted before. The metadata should contain whatever is necessary to be able to replay the exact batch for the transaction at a later point.

      The metadata is stored in Zookeeper.

      Storm uses JSON encoding to store the metadata. Only simple types such as numbers, booleans, strings, lists, and maps should be used.

      Specified by:
        `initializeTransaction` in interface `ITridentSpout.BatchCoordinator<Map<Integer,List<List<Object>>>>`
      Parameters:
        `txid` - The id of the transaction.
        `prevMetadata` - The metadata of the previous transaction
        `currMetadata` - The metadata for this transaction the last time it was initialized. null if this is the first attempt
      Returns:
        the metadata for this new transaction

    - #### close

          public void close()

      Description copied from interface: `ITridentSpout.BatchCoordinator`

      Release any resources from this coordinator.

      Specified by:
        `close` in interface `ITridentSpout.BatchCoordinator<Map<Integer,List<List<Object>>>>`

    - #### success

          public void success(long txid)

      Description copied from interface: `ITridentSpout.BatchCoordinator`

      This attempt committed successfully, so all state for this commit and before can be safely cleaned up.

      Specified by:
        `success` in interface `ITridentSpout.BatchCoordinator<Map<Integer,List<List<Object>>>>`
      Parameters:
        `txid` - transaction id that completed

    - #### isReady

          public boolean isReady(long txid)

      Description copied from interface: `ITridentSpout.BatchCoordinator`

      hint to Storm if the spout is ready for the transaction id.

      Specified by:
        `isReady` in interface `ITridentSpout.BatchCoordinator<Map<Integer,List<List<Object>>>>`
      Parameters:
        `txid` - the id of the transaction
      Returns:
        true, if the spout is ready for the given transaction id

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