Package com.google.spanner.v1
Class RoutingHint
java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessageV3
com.google.spanner.v1.RoutingHint
- All Implemented Interfaces:
com.google.protobuf.Message,com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,RoutingHintOrBuilder,Serializable
public final class RoutingHint
extends com.google.protobuf.GeneratedMessageV3
implements RoutingHintOrBuilder
`RoutingHint` can be optionally added to location-aware Spanner requests. It gives the server hints that can be used to route the request to an appropriate server, potentially significantly decreasing latency and improving throughput. To achieve improved performance, most fields must be filled in with accurate values. The presence of a valid `RoutingHint` tells the server that the client is location-aware. `RoutingHint` does not change the semantics of the request; it is purely a performance hint; the request will perform the same actions on the database's data as if `RoutingHint` were not present. However, if the `RoutingHint` is incomplete or incorrect, the response may include a `CacheUpdate` the client can use to correct its location cache.Protobuf type
google.spanner.v1.RoutingHint- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class`RoutingHint` can be optionally added to location-aware Spanner requests.static final classA tablet that was skipped by the client.static interfaceNested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT, BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class com.google.protobuf.GeneratedMessageV3
alwaysUseFieldBuilders, unknownFieldsFields inherited from class com.google.protobuf.AbstractMessage
memoizedSizeFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Method Summary
Modifier and TypeMethodDescriptionbooleanIf present, the client's current location.com.google.protobuf.ByteStringIf present, the client's current location.longThe database ID of the database being accessed, see `CacheUpdate.database_id`.static RoutingHintstatic final com.google.protobuf.Descriptors.DescriptorlongThe group UID of the group that the client believes serves the range defined by `key` and `limit_key`.com.google.protobuf.ByteStringgetKey()The key / key range that this request accesses.com.google.protobuf.ByteStringIf this request targets a key range, this is the exclusive end of the range.longA session-scoped unique ID for the operation, computed client-side.com.google.protobuf.Parser<RoutingHint>com.google.protobuf.ByteStringThe schema generation of the recipe that was used to generate `key` and `limit_key`.intgetSkippedTabletUid(int index) If the client had multiple options for tablet selection, and some of its first choices were unhealthy (e.g., the server is unreachable, or `Tablet.skip` is true), this field will contain the tablet UIDs of those tablets, with their incarnations.intIf the client had multiple options for tablet selection, and some of its first choices were unhealthy (e.g., the server is unreachable, or `Tablet.skip` is true), this field will contain the tablet UIDs of those tablets, with their incarnations.If the client had multiple options for tablet selection, and some of its first choices were unhealthy (e.g., the server is unreachable, or `Tablet.skip` is true), this field will contain the tablet UIDs of those tablets, with their incarnations.getSkippedTabletUidOrBuilder(int index) If the client had multiple options for tablet selection, and some of its first choices were unhealthy (e.g., the server is unreachable, or `Tablet.skip` is true), this field will contain the tablet UIDs of those tablets, with their incarnations.List<? extends RoutingHint.SkippedTabletOrBuilder>If the client had multiple options for tablet selection, and some of its first choices were unhealthy (e.g., the server is unreachable, or `Tablet.skip` is true), this field will contain the tablet UIDs of those tablets, with their incarnations.longThe split ID of the split that the client believes contains the range defined by `key` and `limit_key`.longThe tablet UID of the tablet from group `group_uid` that the client believes is best to serve this request.inthashCode()protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTablefinal booleanstatic RoutingHint.Builderstatic RoutingHint.BuildernewBuilder(RoutingHint prototype) protected RoutingHint.BuildernewBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) protected ObjectnewInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) static RoutingHintparseDelimitedFrom(InputStream input) static RoutingHintparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static RoutingHintparseFrom(byte[] data) static RoutingHintparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static RoutingHintparseFrom(com.google.protobuf.ByteString data) static RoutingHintparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static RoutingHintparseFrom(com.google.protobuf.CodedInputStream input) static RoutingHintparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static RoutingHintparseFrom(InputStream input) static RoutingHintparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static RoutingHintparseFrom(ByteBuffer data) static RoutingHintparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<RoutingHint>parser()voidwriteTo(com.google.protobuf.CodedOutputStream output) Methods inherited from class com.google.protobuf.GeneratedMessageV3
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagMethods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Field Details
-
OPERATION_UID_FIELD_NUMBER
public static final int OPERATION_UID_FIELD_NUMBER- See Also:
-
DATABASE_ID_FIELD_NUMBER
public static final int DATABASE_ID_FIELD_NUMBER- See Also:
-
SCHEMA_GENERATION_FIELD_NUMBER
public static final int SCHEMA_GENERATION_FIELD_NUMBER- See Also:
-
KEY_FIELD_NUMBER
public static final int KEY_FIELD_NUMBER- See Also:
-
LIMIT_KEY_FIELD_NUMBER
public static final int LIMIT_KEY_FIELD_NUMBER- See Also:
-
GROUP_UID_FIELD_NUMBER
public static final int GROUP_UID_FIELD_NUMBER- See Also:
-
SPLIT_ID_FIELD_NUMBER
public static final int SPLIT_ID_FIELD_NUMBER- See Also:
-
TABLET_UID_FIELD_NUMBER
public static final int TABLET_UID_FIELD_NUMBER- See Also:
-
SKIPPED_TABLET_UID_FIELD_NUMBER
public static final int SKIPPED_TABLET_UID_FIELD_NUMBER- See Also:
-
CLIENT_LOCATION_FIELD_NUMBER
public static final int CLIENT_LOCATION_FIELD_NUMBER- See Also:
-
-
Method Details
-
newInstance
- Overrides:
newInstancein classcom.google.protobuf.GeneratedMessageV3
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3
-
getOperationUid
public long getOperationUid()A session-scoped unique ID for the operation, computed client-side. Requests with the same `operation_uid` should have a shared 'shape', meaning that some fields are expected to be the same, such as the SQL query, the target table/columns (for reads) etc. Requests with the same `operation_uid` are meant to differ only in fields like keys/key ranges/query parameters, transaction IDs, etc. `operation_uid` must be non-zero for `RoutingHint` to be valid.
uint64 operation_uid = 1;- Specified by:
getOperationUidin interfaceRoutingHintOrBuilder- Returns:
- The operationUid.
-
getDatabaseId
public long getDatabaseId()The database ID of the database being accessed, see `CacheUpdate.database_id`. Should match the cache entries that were used to generate the rest of the fields in this `RoutingHint`.
uint64 database_id = 2;- Specified by:
getDatabaseIdin interfaceRoutingHintOrBuilder- Returns:
- The databaseId.
-
getSchemaGeneration
public com.google.protobuf.ByteString getSchemaGeneration()The schema generation of the recipe that was used to generate `key` and `limit_key`. See also `RecipeList.schema_generation`.
bytes schema_generation = 3;- Specified by:
getSchemaGenerationin interfaceRoutingHintOrBuilder- Returns:
- The schemaGeneration.
-
getKey
public com.google.protobuf.ByteString getKey()The key / key range that this request accesses. For operations that access a single key, `key` should be set and `limit_key` should be empty. For operations that access a key range, `key` and `limit_key` should both be set, to the inclusive start and exclusive end of the range respectively. The keys are encoded in "sortable string format" (ssformat), using a `KeyRecipe` that is appropriate for the request. See `KeyRecipe` for more details.
bytes key = 4;- Specified by:
getKeyin interfaceRoutingHintOrBuilder- Returns:
- The key.
-
getLimitKey
public com.google.protobuf.ByteString getLimitKey()If this request targets a key range, this is the exclusive end of the range. See `key` for more details.
bytes limit_key = 5;- Specified by:
getLimitKeyin interfaceRoutingHintOrBuilder- Returns:
- The limitKey.
-
getGroupUid
public long getGroupUid()The group UID of the group that the client believes serves the range defined by `key` and `limit_key`. See `Range.group_uid` for more details.
uint64 group_uid = 6;- Specified by:
getGroupUidin interfaceRoutingHintOrBuilder- Returns:
- The groupUid.
-
getSplitId
public long getSplitId()The split ID of the split that the client believes contains the range defined by `key` and `limit_key`. See `Range.split_id` for more details.
uint64 split_id = 7;- Specified by:
getSplitIdin interfaceRoutingHintOrBuilder- Returns:
- The splitId.
-
getTabletUid
public long getTabletUid()The tablet UID of the tablet from group `group_uid` that the client believes is best to serve this request. See `Group.local_tablet_uids` and `Group.leader_tablet_uid`.
uint64 tablet_uid = 8;- Specified by:
getTabletUidin interfaceRoutingHintOrBuilder- Returns:
- The tabletUid.
-
getSkippedTabletUidList
If the client had multiple options for tablet selection, and some of its first choices were unhealthy (e.g., the server is unreachable, or `Tablet.skip` is true), this field will contain the tablet UIDs of those tablets, with their incarnations. The server may include a `CacheUpdate` with new locations for those tablets.
repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9;- Specified by:
getSkippedTabletUidListin interfaceRoutingHintOrBuilder
-
getSkippedTabletUidOrBuilderList
If the client had multiple options for tablet selection, and some of its first choices were unhealthy (e.g., the server is unreachable, or `Tablet.skip` is true), this field will contain the tablet UIDs of those tablets, with their incarnations. The server may include a `CacheUpdate` with new locations for those tablets.
repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9;- Specified by:
getSkippedTabletUidOrBuilderListin interfaceRoutingHintOrBuilder
-
getSkippedTabletUidCount
public int getSkippedTabletUidCount()If the client had multiple options for tablet selection, and some of its first choices were unhealthy (e.g., the server is unreachable, or `Tablet.skip` is true), this field will contain the tablet UIDs of those tablets, with their incarnations. The server may include a `CacheUpdate` with new locations for those tablets.
repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9;- Specified by:
getSkippedTabletUidCountin interfaceRoutingHintOrBuilder
-
getSkippedTabletUid
If the client had multiple options for tablet selection, and some of its first choices were unhealthy (e.g., the server is unreachable, or `Tablet.skip` is true), this field will contain the tablet UIDs of those tablets, with their incarnations. The server may include a `CacheUpdate` with new locations for those tablets.
repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9;- Specified by:
getSkippedTabletUidin interfaceRoutingHintOrBuilder
-
getSkippedTabletUidOrBuilder
If the client had multiple options for tablet selection, and some of its first choices were unhealthy (e.g., the server is unreachable, or `Tablet.skip` is true), this field will contain the tablet UIDs of those tablets, with their incarnations. The server may include a `CacheUpdate` with new locations for those tablets.
repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9;- Specified by:
getSkippedTabletUidOrBuilderin interfaceRoutingHintOrBuilder
-
getClientLocation
If present, the client's current location. This should be the name of a Google Cloud zone or region, such as "us-central1". If absent, the client's location will be assumed to be the same as the location of the server the client ends up connected to. Locations are primarily valuable for clients that connect from regions other than the ones that contain the Spanner database.
string client_location = 10;- Specified by:
getClientLocationin interfaceRoutingHintOrBuilder- Returns:
- The clientLocation.
-
getClientLocationBytes
public com.google.protobuf.ByteString getClientLocationBytes()If present, the client's current location. This should be the name of a Google Cloud zone or region, such as "us-central1". If absent, the client's location will be assumed to be the same as the location of the server the client ends up connected to. Locations are primarily valuable for clients that connect from regions other than the ones that contain the Spanner database.
string client_location = 10;- Specified by:
getClientLocationBytesin interfaceRoutingHintOrBuilder- Returns:
- The bytes for clientLocation.
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3
-
writeTo
- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessageV3- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessageV3
-
equals
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein classcom.google.protobuf.AbstractMessage
-
parseFrom
public static RoutingHint parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RoutingHint parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RoutingHint parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RoutingHint parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RoutingHint parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static RoutingHint parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static RoutingHint parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static RoutingHint parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static RoutingHint parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
newBuilderForType
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
-
toBuilder
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected RoutingHint.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) - Specified by:
newBuilderForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstance
-
parser
-
getParserForType
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-