Enum PubSubStartPosition.Mode

java.lang.Object
java.lang.Enum<PubSubStartPosition.Mode>
io.github.flink.gcp.connector.pubsub.source.PubSubStartPosition.Mode
All Implemented Interfaces:
Serializable, Comparable<PubSubStartPosition.Mode>, java.lang.constant.Constable
Enclosing class:
PubSubStartPosition

@Public public static enum PubSubStartPosition.Mode extends Enum<PubSubStartPosition.Mode>
Which starting point a PubSubStartPosition names.

toString() returns the hyphenated spelling rather than the constant name, because that spelling is what a SQL WITH clause is written in: Flink resolves an enum ConfigOption by matching the configured value against toString(), case-insensitively and with no other normalization. Flink's own DeliveryGuarantee carries its option spelling the same way.

  • Enum Constant Details

    • CONTINUE_FROM_SUBSCRIPTION

      public static final PubSubStartPosition.Mode CONTINUE_FROM_SUBSCRIPTION
      Starts wherever the subscription already is, delivering whatever it has not acknowledged. The default, and the only mode that issues no seek and so leaves other consumers alone.
    • EARLIEST_RETAINED

      public static final PubSubStartPosition.Mode EARLIEST_RETAINED
      Starts from the oldest message the subscription still holds, replaying its whole retained backlog.

      How far back that reaches is a property of the subscription, not of this setting: acknowledged messages are only replayable if the subscription retains them or its topic does. Against a subscription with neither, this recovers only what was never acknowledged.

    • LATEST

      public static final PubSubStartPosition.Mode LATEST
      Starts from messages published after the job starts, discarding the existing backlog by marking it acknowledged.

      This drops data — everything already in the subscription. It also resolves against the clock at the moment the seek runs, so it is the one mode that is not reproducible: a failover before the source assigns any split seeks again, to a later instant, discarding whatever arrived in between.

    • TIMESTAMP

      public static final PubSubStartPosition.Mode TIMESTAMP
      Starts from a given instant: messages published before it are marked acknowledged, those published after it unacknowledged. Subject to the same retention limits as EARLIEST_RETAINED when the instant is in the past.
  • Method Details

    • values

      public static PubSubStartPosition.Mode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static PubSubStartPosition.Mode 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
    • toString

      public String toString()
      Overrides:
      toString in class Enum<PubSubStartPosition.Mode>