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

## Class KafkaTridentSpoutBatchMetadata

- java.lang.Object
- - org.apache.storm.kafka.spout.trident.KafkaTridentSpoutBatchMetadata

- All Implemented Interfaces:
    `Serializable`

      public class KafkaTridentSpoutBatchMetadata
      extends Object
      implements Serializable

  Wraps transaction batch information.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static String` | `FIRST_OFFSET_KEY` |
    `static String` | `LAST_OFFSET_KEY` |
    `static String` | `TOPOLOGY_ID_KEY` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `KafkaTridentSpoutBatchMetadata​(long firstOffset, long lastOffset, String topologyId)` | Builds a metadata object.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static KafkaTridentSpoutBatchMetadata` | `fromMap​(Map<String,​Object> map)` | Constructs a metadata object from a Map in the format produced by `toMap()`.
    `long` | `getFirstOffset()` |
    `long` | `getLastOffset()` |
    `String` | `getTopologyId()` |
    `Map<String,​Object>` | `toMap()` | Writes this metadata object to a Map so Trident can read/write it to Zookeeper.
    `String` | `toString()` |

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

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

- - ### Field Detail

    - #### FIRST_OFFSET_KEY

          public static final String FIRST_OFFSET_KEY

      See Also:
        Constant Field Values

    - #### LAST_OFFSET_KEY

          public static final String LAST_OFFSET_KEY

      See Also:
        Constant Field Values

    - #### TOPOLOGY_ID_KEY

          public static final String TOPOLOGY_ID_KEY

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### KafkaTridentSpoutBatchMetadata

          public KafkaTridentSpoutBatchMetadata​(long firstOffset,
                                                long lastOffset,
                                                String topologyId)

      Builds a metadata object.
      Parameters:
        `firstOffset` - The first offset for the batch
        `lastOffset` - The last offset for the batch

  - ### Method Detail

    - #### getFirstOffset

          public long getFirstOffset()

    - #### getLastOffset

          public long getLastOffset()

    - #### getTopologyId

          public String getTopologyId()

    - #### fromMap

          public static KafkaTridentSpoutBatchMetadata fromMap​(Map<String,​Object> map)

      Constructs a metadata object from a Map in the format produced by `toMap()`.
      Parameters:
        `map` - The source map
      Returns:
        A new metadata object

    - #### toMap

          public Map<String,​Object> toMap()

      Writes this metadata object to a Map so Trident can read/write it to Zookeeper.

    - #### toString

          public final String toString()

      Overrides:
        `toString` in class `Object`