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 final String`
  `FIRST_OFFSET_KEY`
  `static final String`
  `LAST_OFFSET_KEY`
  `static final String`
  `TOPOLOGY_ID_KEY`

- ## Constructor Summary

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

- ## Method Summary

  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.
  `final String`
  `toString()`

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

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

- ## Field Details

  - ### 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 Details

  - ### 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 Details

  - ### 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`