Enum SpannerRpcPriority
- All Implemented Interfaces:
Serializable,Comparable<SpannerRpcPriority>,java.lang.constant.Constable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptioncom.google.cloud.spanner.Options.RpcPriorityMaps this connector's priority onto the client library's.static SpannerRpcPriorityReturns the enum constant of this type with the specified name.static SpannerRpcPriority[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
LOW
Yields to other traffic on the instance. -
MEDIUM
Between the other two. -
HIGH
Competes with serving traffic — and what leaving the priority unset amounts to, since Spanner definesPRIORITY_UNSPECIFIEDas equivalent toPRIORITY_HIGH. So settingMEDIUMis a step down from the default, not a restatement of it.
-
-
Method Details
-
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
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 nameNullPointerException- 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
-