Enum OrderingMode

java.lang.Object
java.lang.Enum<OrderingMode>
io.github.flink.gcp.connector.spanner.sink.OrderingMode
All Implemented Interfaces:
Serializable, Comparable<OrderingMode>, java.lang.constant.Constable

@Experimental public enum OrderingMode extends Enum<OrderingMode>
Whether the sink applies mutations of one row in the order a sink subtask received them.

Submission order is worth keeping only when the input already has an order per row and every mutation of a row reaches the same sink subtask: a Table API changelog that Flink shuffles by its primary key, or a stream keyed by primary key before the sink. Each subtask orders only what it receives, so input that spreads one row's mutations over several subtasks stays unordered whatever this mode says.

See Also:
  • Enum Constant Details

    • NONE

      public static final OrderingMode NONE
      No order between mutations of one row within a batch write request (default). Spanner applies the mutation groups of one request in an unspecified order, so an insertOrUpdate followed by a delete of the same row in one request can leave the row in place. Requests are sent one at a time, so mutations in different requests keep their order, unless the service applies an attempt that timed out on the client after a later request.
    • PER_KEY

      public static final OrderingMode PER_KEY
      Applies mutations of one row in the order the subtask received them. The writer sends its batch before a mutation whose row the batch already holds, so no request carries a row twice. Mutations of other rows still share requests.

      The row is the table and the primary-key values, with the primary key and its column types read from the database's INFORMATION_SCHEMA when the writer opens, and read again, once per name, when a mutation names a table they do not list. A mutation whose row the writer cannot name, such as a delete of a key range, is ordered against every mutation of its table instead, and a mutation of a table the new read does not list either, such as a synonym, against every mutation of the batch. A row written many times in a row costs one request per mutation, and an attempt that timed out on the client can still be applied by the service after a later request. A primary key changed by dropping a table and creating it again is not detected; restart the job after such a change.

  • Method Details

    • values

      public static OrderingMode[] 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 OrderingMode 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()
      Returns the spelling a WITH clause uses.
      Overrides:
      toString in class Enum<OrderingMode>