Class Tablet

java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessageV3
com.google.spanner.v1.Tablet
All Implemented Interfaces:
com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, TabletOrBuilder, Serializable

public final class Tablet extends com.google.protobuf.GeneratedMessageV3 implements TabletOrBuilder
 A `Tablet` represents a single replica of a `Group`. A tablet is served by a
 single server at a time, and can move between servers due to server death or
 simply load balancing.
 
Protobuf type google.spanner.v1.Tablet
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    A `Tablet` represents a single replica of a `Group`.
    static enum 
    Indicates the role of the tablet.

    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
     

    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
     
    static Tablet
     
     
    static final com.google.protobuf.Descriptors.Descriptor
     
    int
    Distances help the client pick the closest tablet out of the list of tablets for a given request.
    com.google.protobuf.ByteString
    `incarnation` indicates the freshness of the tablet information contained in this proto.
    Where this tablet is located.
    com.google.protobuf.ByteString
    Where this tablet is located.
    com.google.protobuf.Parser<Tablet>
     
    The role of the tablet.
    int
    The role of the tablet.
    int
     
    The address of the server that is serving this tablet -- either an IP address or DNS hostname and a port number.
    com.google.protobuf.ByteString
    The address of the server that is serving this tablet -- either an IP address or DNS hostname and a port number.
    boolean
    If true, the tablet should not be chosen by the client.
    long
    The UID of the tablet, unique within the database.
    int
     
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
     
    final boolean
     
     
    newBuilder(Tablet prototype)
     
     
    protected Tablet.Builder
    newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
     
    protected Object
    newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
     
    static Tablet
     
    static Tablet
    parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static Tablet
    parseFrom(byte[] data)
     
    static Tablet
    parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static Tablet
    parseFrom(com.google.protobuf.ByteString data)
     
    static Tablet
    parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static Tablet
    parseFrom(com.google.protobuf.CodedInputStream input)
     
    static Tablet
    parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static Tablet
     
    static Tablet
    parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static Tablet
     
    static Tablet
    parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static com.google.protobuf.Parser<Tablet>
     
     
    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

  • 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
    • getTabletUid

      public long getTabletUid()
       The UID of the tablet, unique within the database. Matches the
       `tablet_uids` and `leader_tablet_uid` fields in `Group`.
       
      uint64 tablet_uid = 1;
      Specified by:
      getTabletUid in interface TabletOrBuilder
      Returns:
      The tabletUid.
    • getServerAddress

      public String getServerAddress()
       The address of the server that is serving this tablet -- either an IP
       address or DNS hostname and a port number.
       
      string server_address = 2;
      Specified by:
      getServerAddress in interface TabletOrBuilder
      Returns:
      The serverAddress.
    • getServerAddressBytes

      public com.google.protobuf.ByteString getServerAddressBytes()
       The address of the server that is serving this tablet -- either an IP
       address or DNS hostname and a port number.
       
      string server_address = 2;
      Specified by:
      getServerAddressBytes in interface TabletOrBuilder
      Returns:
      The bytes for serverAddress.
    • getLocation

      public String getLocation()
       Where this tablet is located. This is the name of a Google Cloud region,
       such as "us-central1".
       
      string location = 3;
      Specified by:
      getLocation in interface TabletOrBuilder
      Returns:
      The location.
    • getLocationBytes

      public com.google.protobuf.ByteString getLocationBytes()
       Where this tablet is located. This is the name of a Google Cloud region,
       such as "us-central1".
       
      string location = 3;
      Specified by:
      getLocationBytes in interface TabletOrBuilder
      Returns:
      The bytes for location.
    • getRoleValue

      public int getRoleValue()
       The role of the tablet.
       
      .google.spanner.v1.Tablet.Role role = 4;
      Specified by:
      getRoleValue in interface TabletOrBuilder
      Returns:
      The enum numeric value on the wire for role.
    • getRole

      public Tablet.Role getRole()
       The role of the tablet.
       
      .google.spanner.v1.Tablet.Role role = 4;
      Specified by:
      getRole in interface TabletOrBuilder
      Returns:
      The role.
    • getIncarnation

      public com.google.protobuf.ByteString getIncarnation()
       `incarnation` indicates the freshness of the tablet information contained
       in this proto. Incarnations can be compared lexicographically; if
       incarnation A is greater than incarnation B, then the `Tablet`
       corresponding to A is newer than the `Tablet` corresponding to B, and
       should be used preferentially.
       
      bytes incarnation = 5;
      Specified by:
      getIncarnation in interface TabletOrBuilder
      Returns:
      The incarnation.
    • getDistance

      public int getDistance()
       Distances help the client pick the closest tablet out of the list of
       tablets for a given request. Tablets with lower distances should generally
       be preferred. Tablets with the same distance are approximately equally
       close; the client can choose arbitrarily.
      
       Distances do not correspond precisely to expected latency, geographical
       distance, or anything else. Distances should be compared only between
       tablets of the same group; they are not meaningful between different
       groups.
      
       A value of zero indicates that the tablet may be in the same zone as
       the client, and have minimum network latency. A value less than or equal to
       five indicates that the tablet is thought to be in the same region as the
       client, and may have a few milliseconds of network latency. Values greater
       than five are most likely in a different region, with non-trivial network
       latency.
      
       Clients should use the following algorithm:
         * If the request is using a directed read, eliminate any tablets that
           do not match the directed read's target zone and/or replica type.
         * (Read-write transactions only) Choose leader tablet if it has an
           distance <=5.
         * Group and sort tablets by distance. Choose a random
           tablet with the lowest distance. If the request
           is not a directed read, only consider replicas with distances <=5.
         * Send the request to the fallback endpoint.
      
       The tablet picked by this algorithm may be skipped, either because it is
       marked as `skip` by the server or because the corresponding server is
       unreachable, flow controlled, etc. Skipped tablets should be added to the
       `skipped_tablet_uid` field in `RoutingHint`; the algorithm above should
       then be re-run without including the skipped tablet(s) to pick the next
       best tablet.
       
      uint32 distance = 6;
      Specified by:
      getDistance in interface TabletOrBuilder
      Returns:
      The distance.
    • getSkip

      public boolean getSkip()
       If true, the tablet should not be chosen by the client. Typically, this
       signals that the tablet is unhealthy in some way. Tablets with `skip`
       set to true should be reported back to the server in
       `RoutingHint.skipped_tablet_uid`; this cues the server to send updated
       information for this tablet should it become usable again.
       
      bool skip = 7;
      Specified by:
      getSkip in interface TabletOrBuilder
      Returns:
      The skip.
    • 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 Tablet parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Tablet parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Tablet parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Tablet parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Tablet parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Tablet parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

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

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

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

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

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

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

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

      public static Tablet.Builder newBuilder()
    • newBuilder

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

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

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

      public static Tablet getDefaultInstance()
    • parser

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

      public com.google.protobuf.Parser<Tablet> 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 Tablet getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder