org.apache.storm.kafka.spout

## Enum FirstPollOffsetStrategy

- java.lang.Object
- - java.lang.Enum<FirstPollOffsetStrategy>
  - - org.apache.storm.kafka.spout.FirstPollOffsetStrategy

- All Implemented Interfaces:
    Serializable, Comparable<FirstPollOffsetStrategy>

      public enum FirstPollOffsetStrategy
      extends Enum<FirstPollOffsetStrategy>

  Defines how the spout seeks the offset to be used in the first poll to Kafka upon topology deployment. By default this parameter is set to UNCOMMITTED_EARLIEST.

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `EARLIEST` The kafka spout polls records starting in the first offset of the partition, regardless of previous commits.
    `LATEST` The kafka spout polls records starting at the end of the partition, regardless of previous commits.
    `TIMESTAMP` The kafka spout polls records starting at the earliest offset whose timestamp is greater than or equal to the given startTimestamp.
    `UNCOMMITTED_EARLIEST` The kafka spout polls records from the last committed offset, if any.
    `UNCOMMITTED_LATEST` The kafka spout polls records from the last committed offset, if any.
    `UNCOMMITTED_TIMESTAMP` The kafka spout polls records from the last committed offset, if any.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static FirstPollOffsetStrategy` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static FirstPollOffsetStrategy[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

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

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### EARLIEST

          public static final FirstPollOffsetStrategy EARLIEST

      The kafka spout polls records starting in the first offset of the partition, regardless of previous commits. This setting only takes effect on topology deployment

    - #### LATEST

          public static final FirstPollOffsetStrategy LATEST

      The kafka spout polls records starting at the end of the partition, regardless of previous commits. This setting only takes effect on topology deployment

    - #### TIMESTAMP

          public static final FirstPollOffsetStrategy TIMESTAMP

      The kafka spout polls records starting at the earliest offset whose timestamp is greater than or equal to the given startTimestamp. This setting only takes effect on topology deployment. This option is currently available only for the Trident Spout

    - #### UNCOMMITTED_EARLIEST

          public static final FirstPollOffsetStrategy UNCOMMITTED_EARLIEST

      The kafka spout polls records from the last committed offset, if any. If no offset has been committed it behaves as EARLIEST

    - #### UNCOMMITTED_LATEST

          public static final FirstPollOffsetStrategy UNCOMMITTED_LATEST

      The kafka spout polls records from the last committed offset, if any. If no offset has been committed it behaves as LATEST

    - #### UNCOMMITTED_TIMESTAMP

          public static final FirstPollOffsetStrategy UNCOMMITTED_TIMESTAMP

      The kafka spout polls records from the last committed offset, if any. If no offset has been committed it behaves as TIMESTAMP. This option is currently available only for the Trident Spout

  - ### Method Detail

    - #### values

          public static FirstPollOffsetStrategy[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (FirstPollOffsetStrategy c : FirstPollOffsetStrategy.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static FirstPollOffsetStrategy valueOf(String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `IllegalArgumentException` - if this enum type has no constant with the specified name
        `NullPointerException` - if the argument is null

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