Enum Class BarrierCutStatus

java.lang.Object
java.lang.Enum<BarrierCutStatus>
io.krabka.streams.columnar.barrier.BarrierCutStatus
All Implemented Interfaces:
Serializable, Comparable<BarrierCutStatus>, Constable

public enum BarrierCutStatus extends Enum<BarrierCutStatus>
Whether a barrier coordinator reached every partition of a cut.

The coordinator publishes both outcomes to __barrier_state. A complete cut has a marker offset for every partition of the barrier group. A partial cut has partitions that never received a marker, so no task can align on it: the missing partitions would never reach the cut. BarrierCutReader returns complete cuts only.

Example

if (cut.status() == BarrierCutStatus.PARTIAL) {
    log.warn("epoch {} missed {}", cut.epoch(), cut.missing());
}
  • Enum Constant Details

    • COMPLETE

      public static final BarrierCutStatus COMPLETE
      Every partition of the barrier group received the epoch's marker.
    • PARTIAL

      public static final BarrierCutStatus PARTIAL
      One or more partitions never received the epoch's marker.
  • Method Details

    • values

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

      public static BarrierCutStatus valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • code

      public int code()
      Returns the wire code the coordinator writes for this status.
      Returns:
      0 for COMPLETE and 1 for PARTIAL
    • fromCode

      public static BarrierCutStatus fromCode(int code)
      Maps a wire code onto a status.
      Parameters:
      code - the status byte read from a cut record
      Returns:
      the matching status
      Throws:
      ColumnarException - if no status carries the code