Class Tablet.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessageV3.Builder<Tablet.Builder>
com.google.spanner.v1.Tablet.Builder
All Implemented Interfaces:
com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, TabletOrBuilder, Cloneable
Enclosing class:
Tablet

public static final class Tablet.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Tablet.Builder> 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
  • Method Summary

    Modifier and Type
    Method
    Description
    addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
     
     
     
     
    Distances help the client pick the closest tablet out of the list of tablets for a given request.
    clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
     
    `incarnation` indicates the freshness of the tablet information contained in this proto.
    Where this tablet is located.
    clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
     
    The role of the tablet.
    The address of the server that is serving this tablet -- either an IP address or DNS hostname and a port number.
    If true, the tablet should not be chosen by the client.
    The UID of the tablet, unique within the database.
     
     
    static final com.google.protobuf.Descriptors.Descriptor
     
    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.
    The role of the tablet.
    int
    The role of the tablet.
    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.
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
     
    final boolean
     
    mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    mergeFrom(com.google.protobuf.Message other)
     
     
    mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
     
    setDistance(int value)
    Distances help the client pick the closest tablet out of the list of tablets for a given request.
    setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
     
    setIncarnation(com.google.protobuf.ByteString value)
    `incarnation` indicates the freshness of the tablet information contained in this proto.
    Where this tablet is located.
    setLocationBytes(com.google.protobuf.ByteString value)
    Where this tablet is located.
    setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
     
    The role of the tablet.
    setRoleValue(int value)
    The role of the tablet.
    The address of the server that is serving this tablet -- either an IP address or DNS hostname and a port number.
    setServerAddressBytes(com.google.protobuf.ByteString value)
    The address of the server that is serving this tablet -- either an IP address or DNS hostname and a port number.
    setSkip(boolean value)
    If true, the tablet should not be chosen by the client.
    setTabletUid(long value)
    The UID of the tablet, unique within the database.
    setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
     

    Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder

    getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3

    Methods inherited from class com.google.protobuf.AbstractMessage.Builder

    findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString

    Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder

    addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.google.protobuf.Message.Builder

    mergeDelimitedFrom, mergeDelimitedFrom

    Methods inherited from interface com.google.protobuf.MessageLite.Builder

    mergeFrom

    Methods inherited from interface com.google.protobuf.MessageOrBuilder

    findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
  • Method Details

    • 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.Builder<Tablet.Builder>
    • clear

      public Tablet.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessageV3.Builder<Tablet.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<Tablet.Builder>
    • getDefaultInstanceForType

      public Tablet getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

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

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

      public Tablet.Builder clone()
      Specified by:
      clone in interface com.google.protobuf.Message.Builder
      Specified by:
      clone in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clone in class com.google.protobuf.GeneratedMessageV3.Builder<Tablet.Builder>
    • setField

      public Tablet.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      setField in interface com.google.protobuf.Message.Builder
      Overrides:
      setField in class com.google.protobuf.GeneratedMessageV3.Builder<Tablet.Builder>
    • clearField

      public Tablet.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
      Specified by:
      clearField in interface com.google.protobuf.Message.Builder
      Overrides:
      clearField in class com.google.protobuf.GeneratedMessageV3.Builder<Tablet.Builder>
    • clearOneof

      public Tablet.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
      Specified by:
      clearOneof in interface com.google.protobuf.Message.Builder
      Overrides:
      clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<Tablet.Builder>
    • setRepeatedField

      public Tablet.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
      Specified by:
      setRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Tablet.Builder>
    • addRepeatedField

      public Tablet.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      addRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Tablet.Builder>
    • mergeFrom

      public Tablet.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Tablet.Builder>
    • mergeFrom

      public Tablet.Builder mergeFrom(Tablet other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<Tablet.Builder>
    • mergeFrom

      public Tablet.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Tablet.Builder>
      Throws:
      IOException
    • 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.
    • setTabletUid

      public Tablet.Builder setTabletUid(long value)
       The UID of the tablet, unique within the database. Matches the
       `tablet_uids` and `leader_tablet_uid` fields in `Group`.
       
      uint64 tablet_uid = 1;
      Parameters:
      value - The tabletUid to set.
      Returns:
      This builder for chaining.
    • clearTabletUid

      public Tablet.Builder clearTabletUid()
       The UID of the tablet, unique within the database. Matches the
       `tablet_uids` and `leader_tablet_uid` fields in `Group`.
       
      uint64 tablet_uid = 1;
      Returns:
      This builder for chaining.
    • 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.
    • setServerAddress

      public Tablet.Builder setServerAddress(String value)
       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;
      Parameters:
      value - The serverAddress to set.
      Returns:
      This builder for chaining.
    • clearServerAddress

      public Tablet.Builder clearServerAddress()
       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;
      Returns:
      This builder for chaining.
    • setServerAddressBytes

      public Tablet.Builder setServerAddressBytes(com.google.protobuf.ByteString value)
       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;
      Parameters:
      value - The bytes for serverAddress to set.
      Returns:
      This builder for chaining.
    • 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.
    • setLocation

      public Tablet.Builder setLocation(String value)
       Where this tablet is located. This is the name of a Google Cloud region,
       such as "us-central1".
       
      string location = 3;
      Parameters:
      value - The location to set.
      Returns:
      This builder for chaining.
    • clearLocation

      public Tablet.Builder clearLocation()
       Where this tablet is located. This is the name of a Google Cloud region,
       such as "us-central1".
       
      string location = 3;
      Returns:
      This builder for chaining.
    • setLocationBytes

      public Tablet.Builder setLocationBytes(com.google.protobuf.ByteString value)
       Where this tablet is located. This is the name of a Google Cloud region,
       such as "us-central1".
       
      string location = 3;
      Parameters:
      value - The bytes for location to set.
      Returns:
      This builder for chaining.
    • 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.
    • setRoleValue

      public Tablet.Builder setRoleValue(int value)
       The role of the tablet.
       
      .google.spanner.v1.Tablet.Role role = 4;
      Parameters:
      value - The enum numeric value on the wire for role to set.
      Returns:
      This builder for chaining.
    • 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.
    • setRole

      public Tablet.Builder setRole(Tablet.Role value)
       The role of the tablet.
       
      .google.spanner.v1.Tablet.Role role = 4;
      Parameters:
      value - The role to set.
      Returns:
      This builder for chaining.
    • clearRole

      public Tablet.Builder clearRole()
       The role of the tablet.
       
      .google.spanner.v1.Tablet.Role role = 4;
      Returns:
      This builder for chaining.
    • 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.
    • setIncarnation

      public Tablet.Builder setIncarnation(com.google.protobuf.ByteString value)
       `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;
      Parameters:
      value - The incarnation to set.
      Returns:
      This builder for chaining.
    • clearIncarnation

      public Tablet.Builder clearIncarnation()
       `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;
      Returns:
      This builder for chaining.
    • 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.
    • setDistance

      public Tablet.Builder setDistance(int value)
       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;
      Parameters:
      value - The distance to set.
      Returns:
      This builder for chaining.
    • clearDistance

      public Tablet.Builder clearDistance()
       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;
      Returns:
      This builder for chaining.
    • 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.
    • setSkip

      public Tablet.Builder setSkip(boolean value)
       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;
      Parameters:
      value - The skip to set.
      Returns:
      This builder for chaining.
    • clearSkip

      public Tablet.Builder clearSkip()
       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;
      Returns:
      This builder for chaining.
    • setUnknownFields

      public final Tablet.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      setUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Tablet.Builder>
    • mergeUnknownFields

      public final Tablet.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      mergeUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Tablet.Builder>