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 Classes
    Modifier and Type
    Class
    Description
    static final class 
    `RoutingHint` can be optionally added to location-aware Spanner requests.
    static final class 
    A tablet that was skipped by the client.
    static interface 
     

    Nested 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

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     

    Fields inherited from class com.google.protobuf.GeneratedMessageV3

    alwaysUseFieldBuilders, unknownFields

    Fields inherited from class com.google.protobuf.AbstractMessage

    memoizedSize

    Fields inherited from class com.google.protobuf.AbstractMessageLite

    memoizedHashCode
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    If present, the client's current location.
    com.google.protobuf.ByteString
    If present, the client's current location.
    long
    The database ID of the database being accessed, see `CacheUpdate.database_id`.
     
     
    static final com.google.protobuf.Descriptors.Descriptor
     
    long
    The group UID of the group that the client believes serves the range defined by `key` and `limit_key`.
    com.google.protobuf.ByteString
    The key / key range that this request accesses.
    com.google.protobuf.ByteString
    If this request targets a key range, this is the exclusive end of the range.
    long
    A session-scoped unique ID for the operation, computed client-side.
    com.google.protobuf.Parser<RoutingHint>
     
    com.google.protobuf.ByteString
    The schema generation of the recipe that was used to generate `key` and `limit_key`.
    int
     
    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.
    int
    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.
    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.
    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.
    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.
    long
    The split ID of the split that the client believes contains the range defined by `key` and `limit_key`.
    long
    The tablet UID of the tablet from group `group_uid` that the client believes is best to serve this request.
    int
     
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
     
    final boolean
     
     
     
     
    newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
     
    protected Object
    newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
     
     
    parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    parseFrom(byte[] data)
     
    parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    parseFrom(com.google.protobuf.ByteString data)
     
    parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    parseFrom(com.google.protobuf.CodedInputStream input)
     
    parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
     
    parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
     
    parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static com.google.protobuf.Parser<RoutingHint>
     
     
    void
    writeTo(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, writeStringNoTag

    Methods inherited from class com.google.protobuf.AbstractMessage

    findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString

    Methods inherited from class com.google.protobuf.AbstractMessageLite

    addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.google.protobuf.MessageLite

    toByteArray, toByteString, writeDelimitedTo, writeTo

    Methods 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

      protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
      Overrides:
      newInstance in class com.google.protobuf.GeneratedMessageV3
    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.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:
      getOperationUid in interface RoutingHintOrBuilder
      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:
      getDatabaseId in interface RoutingHintOrBuilder
      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:
      getSchemaGeneration in interface RoutingHintOrBuilder
      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:
      getKey in interface RoutingHintOrBuilder
      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:
      getLimitKey in interface RoutingHintOrBuilder
      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:
      getGroupUid in interface RoutingHintOrBuilder
      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:
      getSplitId in interface RoutingHintOrBuilder
      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:
      getTabletUid in interface RoutingHintOrBuilder
      Returns:
      The tabletUid.
    • getSkippedTabletUidList

      public List<RoutingHint.SkippedTablet> 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:
      getSkippedTabletUidList in interface RoutingHintOrBuilder
    • getSkippedTabletUidOrBuilderList

      public List<? extends RoutingHint.SkippedTabletOrBuilder> 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:
      getSkippedTabletUidOrBuilderList in interface RoutingHintOrBuilder
    • 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:
      getSkippedTabletUidCount in interface RoutingHintOrBuilder
    • getSkippedTabletUid

      public RoutingHint.SkippedTablet getSkippedTabletUid(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. The server may include a `CacheUpdate`
       with new locations for those tablets.
       
      repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9;
      Specified by:
      getSkippedTabletUid in interface RoutingHintOrBuilder
    • getSkippedTabletUidOrBuilder

      public RoutingHint.SkippedTabletOrBuilder 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. The server may include a `CacheUpdate`
       with new locations for those tablets.
       
      repeated .google.spanner.v1.RoutingHint.SkippedTablet skipped_tablet_uid = 9;
      Specified by:
      getSkippedTabletUidOrBuilder in interface RoutingHintOrBuilder
    • getClientLocation

      public String 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:
      getClientLocation in interface RoutingHintOrBuilder
      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:
      getClientLocationBytes in interface RoutingHintOrBuilder
      Returns:
      The bytes for clientLocation.
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessageV3
    • writeTo

      public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
      Specified by:
      writeTo in interface com.google.protobuf.MessageLite
      Overrides:
      writeTo in class com.google.protobuf.GeneratedMessageV3
      Throws:
      IOException
    • getSerializedSize

      public int getSerializedSize()
      Specified by:
      getSerializedSize in interface com.google.protobuf.MessageLite
      Overrides:
      getSerializedSize in class com.google.protobuf.GeneratedMessageV3
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface com.google.protobuf.Message
      Overrides:
      equals in class com.google.protobuf.AbstractMessage
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface com.google.protobuf.Message
      Overrides:
      hashCode in class com.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

      public static RoutingHint parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static RoutingHint parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static RoutingHint parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static RoutingHint parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static RoutingHint parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static RoutingHint parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilderForType

      public RoutingHint.Builder newBuilderForType()
      Specified by:
      newBuilderForType in interface com.google.protobuf.Message
      Specified by:
      newBuilderForType in interface com.google.protobuf.MessageLite
    • newBuilder

      public static RoutingHint.Builder newBuilder()
    • newBuilder

      public static RoutingHint.Builder newBuilder(RoutingHint prototype)
    • toBuilder

      public RoutingHint.Builder toBuilder()
      Specified by:
      toBuilder in interface com.google.protobuf.Message
      Specified by:
      toBuilder in interface com.google.protobuf.MessageLite
    • newBuilderForType

      protected RoutingHint.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
      Specified by:
      newBuilderForType in class com.google.protobuf.GeneratedMessageV3
    • getDefaultInstance

      public static RoutingHint getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<RoutingHint> parser()
    • getParserForType

      public com.google.protobuf.Parser<RoutingHint> getParserForType()
      Specified by:
      getParserForType in interface com.google.protobuf.Message
      Specified by:
      getParserForType in interface com.google.protobuf.MessageLite
      Overrides:
      getParserForType in class com.google.protobuf.GeneratedMessageV3
    • getDefaultInstanceForType

      public RoutingHint getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder