Package com.google.spanner.executor.v1
Class StartBatchTransactionAction
java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessageV3
com.google.spanner.executor.v1.StartBatchTransactionAction
- All Implemented Interfaces:
com.google.protobuf.Message,com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,StartBatchTransactionActionOrBuilder,Serializable
public final class StartBatchTransactionAction
extends com.google.protobuf.GeneratedMessageV3
implements StartBatchTransactionActionOrBuilder
Starts a batch read-only transaction in executor. Successful outcomes of this action will contain batch_txn_id--the identificator that can be used to start the same transaction in other Executors to parallelize partition processing. Example of a batch read flow: 1. Start batch transaction with a timestamp (StartBatchTransactionAction) 2. Generate database partitions for a read or query (GenerateDbPartitionsForReadAction/GenerateDbPartitionsForQueryAction) 3. Call ExecutePartitionAction for some or all partitions, process rows 4. Clean up the transaction (CloseBatchTransactionAction). More sophisticated example, with parallel processing: 1. Start batch transaction with a timestamp (StartBatchTransactionAction), note the returned BatchTransactionId 2. Generate database partitions for a read or query (GenerateDbPartitionsForReadAction/GenerateDbPartitionsForQueryAction) 3. Distribute the partitions over a pool of workers, along with the transaction ID. In each worker: 4-1. StartBatchTransactionAction with the given transaction ID 4-2. ExecutePartitionAction for each partition it got, process read results 4-3. Close (not cleanup) the transaction (CloseBatchTransactionAction). When all workers are done: 5. Cleanup the transaction (CloseBatchTransactionAction). This can be done either by the last worker to finish the job, or by the main Executor that initialized this transaction in the first place. It is also possible to clean it up with a brand new Executor -- just execute StartBatchTransactionAction with the ID, then clean it up right away. Cleaning up is optional, but recommended.Protobuf type
google.spanner.executor.v1.StartBatchTransactionAction- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classStarts a batch read-only transaction in executor.static enumNested 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 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 TypeMethodDescriptionbooleancom.google.protobuf.TimestampThe exact timestamp to start the batch transaction.com.google.protobuf.TimestampOrBuilderThe exact timestamp to start the batch transaction.Database role to assume while performing this action.com.google.protobuf.ByteStringDatabase role to assume while performing this action.static StartBatchTransactionActionstatic final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Parser<StartBatchTransactionAction>intcom.google.protobuf.ByteStringgetTid()ID of a batch read-only transaction.booleanThe exact timestamp to start the batch transaction.inthashCode()booleanhasTid()ID of a batch read-only transaction.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTablefinal booleannewBuilder(StartBatchTransactionAction prototype) protected StartBatchTransactionAction.BuildernewBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) protected ObjectnewInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) static StartBatchTransactionActionparseDelimitedFrom(InputStream input) static StartBatchTransactionActionparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static StartBatchTransactionActionparseFrom(byte[] data) static StartBatchTransactionActionparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static StartBatchTransactionActionparseFrom(com.google.protobuf.ByteString data) static StartBatchTransactionActionparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static StartBatchTransactionActionparseFrom(com.google.protobuf.CodedInputStream input) static StartBatchTransactionActionparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static StartBatchTransactionActionparseFrom(InputStream input) static StartBatchTransactionActionparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static StartBatchTransactionActionparseFrom(ByteBuffer data) static StartBatchTransactionActionparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<StartBatchTransactionAction>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
-
BATCH_TXN_TIME_FIELD_NUMBER
public static final int BATCH_TXN_TIME_FIELD_NUMBER- See Also:
-
TID_FIELD_NUMBER
public static final int TID_FIELD_NUMBER- See Also:
-
CLOUD_DATABASE_ROLE_FIELD_NUMBER
public static final int CLOUD_DATABASE_ROLE_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
-
getParamCase
- Specified by:
getParamCasein interfaceStartBatchTransactionActionOrBuilder
-
hasBatchTxnTime
public boolean hasBatchTxnTime()The exact timestamp to start the batch transaction.
.google.protobuf.Timestamp batch_txn_time = 1;- Specified by:
hasBatchTxnTimein interfaceStartBatchTransactionActionOrBuilder- Returns:
- Whether the batchTxnTime field is set.
-
getBatchTxnTime
public com.google.protobuf.Timestamp getBatchTxnTime()The exact timestamp to start the batch transaction.
.google.protobuf.Timestamp batch_txn_time = 1;- Specified by:
getBatchTxnTimein interfaceStartBatchTransactionActionOrBuilder- Returns:
- The batchTxnTime.
-
getBatchTxnTimeOrBuilder
public com.google.protobuf.TimestampOrBuilder getBatchTxnTimeOrBuilder()The exact timestamp to start the batch transaction.
.google.protobuf.Timestamp batch_txn_time = 1;- Specified by:
getBatchTxnTimeOrBuilderin interfaceStartBatchTransactionActionOrBuilder
-
hasTid
public boolean hasTid()ID of a batch read-only transaction. It can be used to start the same batch transaction on multiple executors and parallelize partition processing.
bytes tid = 2;- Specified by:
hasTidin interfaceStartBatchTransactionActionOrBuilder- Returns:
- Whether the tid field is set.
-
getTid
public com.google.protobuf.ByteString getTid()ID of a batch read-only transaction. It can be used to start the same batch transaction on multiple executors and parallelize partition processing.
bytes tid = 2;- Specified by:
getTidin interfaceStartBatchTransactionActionOrBuilder- Returns:
- The tid.
-
getCloudDatabaseRole
Database role to assume while performing this action. Setting the database_role will enforce additional role-based access checks on this action.
string cloud_database_role = 3;- Specified by:
getCloudDatabaseRolein interfaceStartBatchTransactionActionOrBuilder- Returns:
- The cloudDatabaseRole.
-
getCloudDatabaseRoleBytes
public com.google.protobuf.ByteString getCloudDatabaseRoleBytes()Database role to assume while performing this action. Setting the database_role will enforce additional role-based access checks on this action.
string cloud_database_role = 3;- Specified by:
getCloudDatabaseRoleBytesin interfaceStartBatchTransactionActionOrBuilder- Returns:
- The bytes for cloudDatabaseRole.
-
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 StartBatchTransactionAction parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static StartBatchTransactionAction parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static StartBatchTransactionAction parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static StartBatchTransactionAction parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static StartBatchTransactionAction parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static StartBatchTransactionAction parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static StartBatchTransactionAction parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static StartBatchTransactionAction parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
public static StartBatchTransactionAction parseFrom(com.google.protobuf.CodedInputStream input) throws IOException - Throws:
IOException
-
parseFrom
public static StartBatchTransactionAction 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 StartBatchTransactionAction.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
-