Package com.google.spanner.executor.v1
Class StartBatchTransactionAction.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessageV3.Builder<StartBatchTransactionAction.Builder>
com.google.spanner.executor.v1.StartBatchTransactionAction.Builder
- All Implemented Interfaces:
com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,StartBatchTransactionActionOrBuilder,Cloneable
- Enclosing class:
- StartBatchTransactionAction
public static final class StartBatchTransactionAction.Builder
extends com.google.protobuf.GeneratedMessageV3.Builder<StartBatchTransactionAction.Builder>
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-
Method Summary
Modifier and TypeMethodDescriptionaddRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) build()clear()The exact timestamp to start the batch transaction.Database role to assume while performing this action.clearField(com.google.protobuf.Descriptors.FieldDescriptor field) clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) clearTid()ID of a batch read-only transaction.clone()com.google.protobuf.TimestampThe exact timestamp to start the batch transaction.com.google.protobuf.Timestamp.BuilderThe 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 final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.Descriptorcom.google.protobuf.ByteStringgetTid()ID of a batch read-only transaction.booleanThe exact timestamp to start the batch transaction.booleanhasTid()ID of a batch read-only transaction.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTablefinal booleanmergeBatchTxnTime(com.google.protobuf.Timestamp value) The exact timestamp to start the batch transaction.mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) setBatchTxnTime(com.google.protobuf.Timestamp value) The exact timestamp to start the batch transaction.setBatchTxnTime(com.google.protobuf.Timestamp.Builder builderForValue) The exact timestamp to start the batch transaction.setCloudDatabaseRole(String value) Database role to assume while performing this action.setCloudDatabaseRoleBytes(com.google.protobuf.ByteString value) Database role to assume while performing this action.setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) setTid(com.google.protobuf.ByteString value) ID of a batch read-only transaction.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, 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<StartBatchTransactionAction.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<StartBatchTransactionAction.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<StartBatchTransactionAction.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<StartBatchTransactionAction.Builder>
-
setField
public StartBatchTransactionAction.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) - Specified by:
setFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<StartBatchTransactionAction.Builder>
-
clearField
public StartBatchTransactionAction.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) - Specified by:
clearFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
clearFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<StartBatchTransactionAction.Builder>
-
clearOneof
public StartBatchTransactionAction.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) - Specified by:
clearOneofin interfacecom.google.protobuf.Message.Builder- Overrides:
clearOneofin classcom.google.protobuf.GeneratedMessageV3.Builder<StartBatchTransactionAction.Builder>
-
setRepeatedField
public StartBatchTransactionAction.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<StartBatchTransactionAction.Builder>
-
addRepeatedField
public StartBatchTransactionAction.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<StartBatchTransactionAction.Builder>
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<StartBatchTransactionAction.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3.Builder<StartBatchTransactionAction.Builder>
-
mergeFrom
public StartBatchTransactionAction.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<StartBatchTransactionAction.Builder>- Throws:
IOException
-
getParamCase
- Specified by:
getParamCasein interfaceStartBatchTransactionActionOrBuilder
-
clearParam
-
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.
-
setBatchTxnTime
The exact timestamp to start the batch transaction.
.google.protobuf.Timestamp batch_txn_time = 1; -
setBatchTxnTime
public StartBatchTransactionAction.Builder setBatchTxnTime(com.google.protobuf.Timestamp.Builder builderForValue) The exact timestamp to start the batch transaction.
.google.protobuf.Timestamp batch_txn_time = 1; -
mergeBatchTxnTime
The exact timestamp to start the batch transaction.
.google.protobuf.Timestamp batch_txn_time = 1; -
clearBatchTxnTime
The exact timestamp to start the batch transaction.
.google.protobuf.Timestamp batch_txn_time = 1; -
getBatchTxnTimeBuilder
public com.google.protobuf.Timestamp.Builder getBatchTxnTimeBuilder()The exact timestamp to start the batch transaction.
.google.protobuf.Timestamp batch_txn_time = 1; -
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.
-
setTid
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;- Parameters:
value- The tid to set.- Returns:
- This builder for chaining.
-
clearTid
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;- Returns:
- This builder for chaining.
-
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.
-
setCloudDatabaseRole
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;- Parameters:
value- The cloudDatabaseRole to set.- Returns:
- This builder for chaining.
-
clearCloudDatabaseRole
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;- Returns:
- This builder for chaining.
-
setCloudDatabaseRoleBytes
public StartBatchTransactionAction.Builder setCloudDatabaseRoleBytes(com.google.protobuf.ByteString value) 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;- Parameters:
value- The bytes for cloudDatabaseRole to set.- Returns:
- This builder for chaining.
-
setUnknownFields
public final StartBatchTransactionAction.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) - Specified by:
setUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
setUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<StartBatchTransactionAction.Builder>
-
mergeUnknownFields
public final StartBatchTransactionAction.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) - Specified by:
mergeUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<StartBatchTransactionAction.Builder>
-