Package com.google.spanner.v1
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 TypeMethodDescriptionaddRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) build()clear()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.clone()static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorintDistances 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.ByteStringWhere this tablet is located.getRole()The role of the tablet.intThe 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.ByteStringThe address of the server that is serving this tablet -- either an IP address or DNS hostname and a port number.booleangetSkip()If true, the tablet should not be chosen by the client.longThe UID of the tablet, unique within the database.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTablefinal booleanmergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) final Tablet.BuildermergeUnknownFields(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.setIncarnation(com.google.protobuf.ByteString value) `incarnation` indicates the freshness of the tablet information contained in this proto.setLocation(String value) 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) setRole(Tablet.Role value) The role of the tablet.setRoleValue(int value) The role of the tablet.setServerAddress(String value) 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.final Tablet.BuildersetUnknownFields(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, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods 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:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3.Builder<Tablet.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessageV3.Builder<Tablet.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessageV3.Builder<Tablet.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
clone
- Specified by:
clonein interfacecom.google.protobuf.Message.Builder- Specified by:
clonein interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clonein classcom.google.protobuf.GeneratedMessageV3.Builder<Tablet.Builder>
-
setField
- Specified by:
setFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<Tablet.Builder>
-
clearField
- Specified by:
clearFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
clearFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<Tablet.Builder>
-
clearOneof
- Specified by:
clearOneofin interfacecom.google.protobuf.Message.Builder- Overrides:
clearOneofin classcom.google.protobuf.GeneratedMessageV3.Builder<Tablet.Builder>
-
setRepeatedField
public Tablet.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) - Specified by:
setRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<Tablet.Builder>
-
addRepeatedField
public Tablet.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) - Specified by:
addRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
addRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<Tablet.Builder>
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<Tablet.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.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:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.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:
getTabletUidin interfaceTabletOrBuilder- Returns:
- The tabletUid.
-
setTabletUid
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
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
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:
getServerAddressin interfaceTabletOrBuilder- 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:
getServerAddressBytesin interfaceTabletOrBuilder- Returns:
- The bytes for serverAddress.
-
setServerAddress
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
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
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
Where this tablet is located. This is the name of a Google Cloud region, such as "us-central1".
string location = 3;- Specified by:
getLocationin interfaceTabletOrBuilder- 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:
getLocationBytesin interfaceTabletOrBuilder- Returns:
- The bytes for location.
-
setLocation
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
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
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:
getRoleValuein interfaceTabletOrBuilder- Returns:
- The enum numeric value on the wire for role.
-
setRoleValue
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
The role of the tablet.
.google.spanner.v1.Tablet.Role role = 4;- Specified by:
getRolein interfaceTabletOrBuilder- Returns:
- The role.
-
setRole
The role of the tablet.
.google.spanner.v1.Tablet.Role role = 4;- Parameters:
value- The role to set.- Returns:
- This builder for chaining.
-
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:
getIncarnationin interfaceTabletOrBuilder- Returns:
- The incarnation.
-
setIncarnation
`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
`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:
getDistancein interfaceTabletOrBuilder- Returns:
- The distance.
-
setDistance
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
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:
getSkipin interfaceTabletOrBuilder- Returns:
- The skip.
-
setSkip
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
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
- Specified by:
setUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
setUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<Tablet.Builder>
-
mergeUnknownFields
- Specified by:
mergeUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<Tablet.Builder>
-