Enum SpannerRpcPriority

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

@Public public enum SpannerRpcPriority extends Enum<SpannerRpcPriority>
The priority Spanner schedules this connector's requests at.

Spanner uses the priority to decide what to shed when an instance is at capacity: a LOW request yields to higher-priority traffic. Two cases this exists for: a streaming sink competing with serving traffic on the same instance, and a batch read of a large table that must not disturb it.

At the module root rather than under sink, because both directions take it — the same reason DatabaseDestination is here.

This mirrors the client library's own priority enum rather than exposing it, so the public API stays free of SDK types and a client upgrade cannot change what a job's configuration means.

  • Enum Constant Details

    • LOW

      public static final SpannerRpcPriority LOW
      Yields to other traffic on the instance.
    • MEDIUM

      public static final SpannerRpcPriority MEDIUM
      Between the other two.
    • HIGH

      public static final SpannerRpcPriority HIGH
      Competes with serving traffic — and what leaving the priority unset amounts to, since Spanner defines PRIORITY_UNSPECIFIED as equivalent to PRIORITY_HIGH. So setting MEDIUM is a step down from the default, not a restatement of it.
  • Method Details

    • values

      public static SpannerRpcPriority[] 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 SpannerRpcPriority 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
    • toSpanner

      @Internal public com.google.cloud.spanner.Options.RpcPriority toSpanner()
      Maps this connector's priority onto the client library's.

      Written out rather than matched by enum name, so that a value added to either side fails to compile here instead of silently changing what a job asked for. One copy, because both directions need the mapping and two switches would drift.

      Returns:
      the client library's priority