Package com.google.spanner.v1
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
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 ClassesModifier and TypeClassDescriptionstatic final classA `Tablet` represents a single replica of a `Group`.static enumIndicates 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
FieldsModifier and TypeFieldDescriptionstatic 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 TypeMethodDescriptionbooleanstatic Tabletstatic final com.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.com.google.protobuf.Parser<Tablet>getRole()The role of the tablet.intThe role of the tablet.intThe 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.inthashCode()protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTablefinal booleanstatic Tablet.Builderstatic Tablet.BuildernewBuilder(Tablet prototype) protected Tablet.BuildernewBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) protected ObjectnewInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) static TabletparseDelimitedFrom(InputStream input) static TabletparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static TabletparseFrom(byte[] data) static TabletparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static TabletparseFrom(com.google.protobuf.ByteString data) static TabletparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static TabletparseFrom(com.google.protobuf.CodedInputStream input) static TabletparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static TabletparseFrom(InputStream input) static TabletparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static TabletparseFrom(ByteBuffer data) static TabletparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<Tablet>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
-
TABLET_UID_FIELD_NUMBER
public static final int TABLET_UID_FIELD_NUMBER- See Also:
-
SERVER_ADDRESS_FIELD_NUMBER
public static final int SERVER_ADDRESS_FIELD_NUMBER- See Also:
-
LOCATION_FIELD_NUMBER
public static final int LOCATION_FIELD_NUMBER- See Also:
-
ROLE_FIELD_NUMBER
public static final int ROLE_FIELD_NUMBER- See Also:
-
INCARNATION_FIELD_NUMBER
public static final int INCARNATION_FIELD_NUMBER- See Also:
-
DISTANCE_FIELD_NUMBER
public static final int DISTANCE_FIELD_NUMBER- See Also:
-
SKIP_FIELD_NUMBER
public static final int SKIP_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
-
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.
-
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.
-
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.
-
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.
-
getRole
The role of the tablet.
.google.spanner.v1.Tablet.Role role = 4;- Specified by:
getRolein interfaceTabletOrBuilder- 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:
getIncarnationin interfaceTabletOrBuilder- 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:
getDistancein interfaceTabletOrBuilder- 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:
getSkipin interfaceTabletOrBuilder- Returns:
- The skip.
-
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 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
- Throws:
IOException
-
parseFrom
public static Tablet parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static Tablet parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static Tablet 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 Tablet.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
-