Class CommitRequest.Builder (6.51.0)

public static final class CommitRequest.Builder extends GeneratedMessageV3.Builder<CommitRequest.Builder> implements CommitRequestOrBuilder

The request for Commit.

Protobuf type google.spanner.v1.CommitRequest

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllMutations(Iterable<? extends Mutation> values)

public CommitRequest.Builder addAllMutations(Iterable<? extends Mutation> values)

The mutations to be executed when this transaction commits. All mutations are applied atomically, in the order they appear in this list.

repeated .google.spanner.v1.Mutation mutations = 4;

Parameter
NameDescription
valuesIterable<? extends com.google.spanner.v1.Mutation>
Returns
TypeDescription
CommitRequest.Builder

addMutations(Mutation value)

public CommitRequest.Builder addMutations(Mutation value)

The mutations to be executed when this transaction commits. All mutations are applied atomically, in the order they appear in this list.

repeated .google.spanner.v1.Mutation mutations = 4;

Parameter
NameDescription
valueMutation
Returns
TypeDescription
CommitRequest.Builder

addMutations(Mutation.Builder builderForValue)

public CommitRequest.Builder addMutations(Mutation.Builder builderForValue)

The mutations to be executed when this transaction commits. All mutations are applied atomically, in the order they appear in this list.

repeated .google.spanner.v1.Mutation mutations = 4;

Parameter
NameDescription
builderForValueMutation.Builder
Returns
TypeDescription
CommitRequest.Builder

addMutations(int index, Mutation value)

public CommitRequest.Builder addMutations(int index, Mutation value)

The mutations to be executed when this transaction commits. All mutations are applied atomically, in the order they appear in this list.

repeated .google.spanner.v1.Mutation mutations = 4;

Parameters
NameDescription
indexint
valueMutation
Returns
TypeDescription
CommitRequest.Builder

addMutations(int index, Mutation.Builder builderForValue)

public CommitRequest.Builder addMutations(int index, Mutation.Builder builderForValue)

The mutations to be executed when this transaction commits. All mutations are applied atomically, in the order they appear in this list.

repeated .google.spanner.v1.Mutation mutations = 4;

Parameters
NameDescription
indexint
builderForValueMutation.Builder
Returns
TypeDescription
CommitRequest.Builder

addMutationsBuilder()

public Mutation.Builder addMutationsBuilder()

The mutations to be executed when this transaction commits. All mutations are applied atomically, in the order they appear in this list.

repeated .google.spanner.v1.Mutation mutations = 4;

Returns
TypeDescription
Mutation.Builder

addMutationsBuilder(int index)

public Mutation.Builder addMutationsBuilder(int index)

The mutations to be executed when this transaction commits. All mutations are applied atomically, in the order they appear in this list.

repeated .google.spanner.v1.Mutation mutations = 4;

Parameter
NameDescription
indexint
Returns
TypeDescription
Mutation.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public CommitRequest.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
CommitRequest.Builder
Overrides

build()

public CommitRequest build()
Returns
TypeDescription
CommitRequest

buildPartial()

public CommitRequest buildPartial()
Returns
TypeDescription
CommitRequest

clear()

public CommitRequest.Builder clear()
Returns
TypeDescription
CommitRequest.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public CommitRequest.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
CommitRequest.Builder
Overrides

clearMutations()

public CommitRequest.Builder clearMutations()

The mutations to be executed when this transaction commits. All mutations are applied atomically, in the order they appear in this list.

repeated .google.spanner.v1.Mutation mutations = 4;

Returns
TypeDescription
CommitRequest.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public CommitRequest.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
CommitRequest.Builder
Overrides

clearRequestOptions()

public CommitRequest.Builder clearRequestOptions()

Common options for this request.

.google.spanner.v1.RequestOptions request_options = 6;

Returns
TypeDescription
CommitRequest.Builder

clearReturnCommitStats()

public CommitRequest.Builder clearReturnCommitStats()

If true, then statistics related to the transaction will be included in the CommitResponse. Default value is false.

bool return_commit_stats = 5;

Returns
TypeDescription
CommitRequest.Builder

This builder for chaining.

clearSession()

public CommitRequest.Builder clearSession()

Required. The session in which the transaction to be committed is running.

string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
CommitRequest.Builder

This builder for chaining.

clearSingleUseTransaction()

public CommitRequest.Builder clearSingleUseTransaction()

Execute mutations in a temporary transaction. Note that unlike commit of a previously-started transaction, commit with a temporary transaction is non-idempotent. That is, if the CommitRequest is sent to Cloud Spanner more than once (for instance, due to retries in the application, or in the transport library), it is possible that the mutations are executed more than once. If this is undesirable, use BeginTransaction and Commit instead.

.google.spanner.v1.TransactionOptions single_use_transaction = 3;

Returns
TypeDescription
CommitRequest.Builder

clearTransaction()

public CommitRequest.Builder clearTransaction()
Returns
TypeDescription
CommitRequest.Builder

clearTransactionId()

public CommitRequest.Builder clearTransactionId()

Commit a previously-started transaction.

bytes transaction_id = 2;

Returns
TypeDescription
CommitRequest.Builder

This builder for chaining.

clone()

public CommitRequest.Builder clone()
Returns
TypeDescription
CommitRequest.Builder
Overrides

getDefaultInstanceForType()

public CommitRequest getDefaultInstanceForType()
Returns
TypeDescription
CommitRequest

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getMutations(int index)

public Mutation getMutations(int index)

The mutations to be executed when this transaction commits. All mutations are applied atomically, in the order they appear in this list.

repeated .google.spanner.v1.Mutation mutations = 4;

Parameter
NameDescription
indexint
Returns
TypeDescription
Mutation

getMutationsBuilder(int index)

public Mutation.Builder getMutationsBuilder(int index)

The mutations to be executed when this transaction commits. All mutations are applied atomically, in the order they appear in this list.

repeated .google.spanner.v1.Mutation mutations = 4;

Parameter
NameDescription
indexint
Returns
TypeDescription
Mutation.Builder

getMutationsBuilderList()

public List<Mutation.Builder> getMutationsBuilderList()

The mutations to be executed when this transaction commits. All mutations are applied atomically, in the order they appear in this list.

repeated .google.spanner.v1.Mutation mutations = 4;

Returns
TypeDescription
List<Builder>

getMutationsCount()

public int getMutationsCount()

The mutations to be executed when this transaction commits. All mutations are applied atomically, in the order they appear in this list.

repeated .google.spanner.v1.Mutation mutations = 4;

Returns
TypeDescription
int

getMutationsList()

public List<Mutation> getMutationsList()

The mutations to be executed when this transaction commits. All mutations are applied atomically, in the order they appear in this list.

repeated .google.spanner.v1.Mutation mutations = 4;

Returns
TypeDescription
List<Mutation>

getMutationsOrBuilder(int index)

public MutationOrBuilder getMutationsOrBuilder(int index)

The mutations to be executed when this transaction commits. All mutations are applied atomically, in the order they appear in this list.

repeated .google.spanner.v1.Mutation mutations = 4;

Parameter
NameDescription
indexint
Returns
TypeDescription
MutationOrBuilder

getMutationsOrBuilderList()

public List<? extends MutationOrBuilder> getMutationsOrBuilderList()

The mutations to be executed when this transaction commits. All mutations are applied atomically, in the order they appear in this list.

repeated .google.spanner.v1.Mutation mutations = 4;

Returns
TypeDescription
List<? extends com.google.spanner.v1.MutationOrBuilder>

getRequestOptions()

public RequestOptions getRequestOptions()

Common options for this request.

.google.spanner.v1.RequestOptions request_options = 6;

Returns
TypeDescription
RequestOptions

The requestOptions.

getRequestOptionsBuilder()

public RequestOptions.Builder getRequestOptionsBuilder()

Common options for this request.

.google.spanner.v1.RequestOptions request_options = 6;

Returns
TypeDescription
RequestOptions.Builder

getRequestOptionsOrBuilder()

public RequestOptionsOrBuilder getRequestOptionsOrBuilder()

Common options for this request.

.google.spanner.v1.RequestOptions request_options = 6;

Returns
TypeDescription
RequestOptionsOrBuilder

getReturnCommitStats()

public boolean getReturnCommitStats()

If true, then statistics related to the transaction will be included in the CommitResponse. Default value is false.

bool return_commit_stats = 5;

Returns
TypeDescription
boolean

The returnCommitStats.

getSession()

public String getSession()

Required. The session in which the transaction to be committed is running.

string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
String

The session.

getSessionBytes()

public ByteString getSessionBytes()

Required. The session in which the transaction to be committed is running.

string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
ByteString

The bytes for session.

getSingleUseTransaction()

public TransactionOptions getSingleUseTransaction()

Execute mutations in a temporary transaction. Note that unlike commit of a previously-started transaction, commit with a temporary transaction is non-idempotent. That is, if the CommitRequest is sent to Cloud Spanner more than once (for instance, due to retries in the application, or in the transport library), it is possible that the mutations are executed more than once. If this is undesirable, use BeginTransaction and Commit instead.

.google.spanner.v1.TransactionOptions single_use_transaction = 3;

Returns
TypeDescription
TransactionOptions

The singleUseTransaction.

getSingleUseTransactionBuilder()

public TransactionOptions.Builder getSingleUseTransactionBuilder()

Execute mutations in a temporary transaction. Note that unlike commit of a previously-started transaction, commit with a temporary transaction is non-idempotent. That is, if the CommitRequest is sent to Cloud Spanner more than once (for instance, due to retries in the application, or in the transport library), it is possible that the mutations are executed more than once. If this is undesirable, use BeginTransaction and Commit instead.

.google.spanner.v1.TransactionOptions single_use_transaction = 3;

Returns
TypeDescription
TransactionOptions.Builder

getSingleUseTransactionOrBuilder()

public TransactionOptionsOrBuilder getSingleUseTransactionOrBuilder()

Execute mutations in a temporary transaction. Note that unlike commit of a previously-started transaction, commit with a temporary transaction is non-idempotent. That is, if the CommitRequest is sent to Cloud Spanner more than once (for instance, due to retries in the application, or in the transport library), it is possible that the mutations are executed more than once. If this is undesirable, use BeginTransaction and Commit instead.

.google.spanner.v1.TransactionOptions single_use_transaction = 3;

Returns
TypeDescription
TransactionOptionsOrBuilder

getTransactionCase()

public CommitRequest.TransactionCase getTransactionCase()
Returns
TypeDescription
CommitRequest.TransactionCase

getTransactionId()

public ByteString getTransactionId()

Commit a previously-started transaction.

bytes transaction_id = 2;

Returns
TypeDescription
ByteString

The transactionId.

hasRequestOptions()

public boolean hasRequestOptions()

Common options for this request.

.google.spanner.v1.RequestOptions request_options = 6;

Returns
TypeDescription
boolean

Whether the requestOptions field is set.

hasSingleUseTransaction()

public boolean hasSingleUseTransaction()

Execute mutations in a temporary transaction. Note that unlike commit of a previously-started transaction, commit with a temporary transaction is non-idempotent. That is, if the CommitRequest is sent to Cloud Spanner more than once (for instance, due to retries in the application, or in the transport library), it is possible that the mutations are executed more than once. If this is undesirable, use BeginTransaction and Commit instead.

.google.spanner.v1.TransactionOptions single_use_transaction = 3;

Returns
TypeDescription
boolean

Whether the singleUseTransaction field is set.

hasTransactionId()

public boolean hasTransactionId()

Commit a previously-started transaction.

bytes transaction_id = 2;

Returns
TypeDescription
boolean

Whether the transactionId field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public CommitRequest.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CommitRequest.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public CommitRequest.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
CommitRequest.Builder
Overrides

mergeFrom(CommitRequest other)

public CommitRequest.Builder mergeFrom(CommitRequest other)
Parameter
NameDescription
otherCommitRequest
Returns
TypeDescription
CommitRequest.Builder

mergeRequestOptions(RequestOptions value)

public CommitRequest.Builder mergeRequestOptions(RequestOptions value)

Common options for this request.

.google.spanner.v1.RequestOptions request_options = 6;

Parameter
NameDescription
valueRequestOptions
Returns
TypeDescription
CommitRequest.Builder

mergeSingleUseTransaction(TransactionOptions value)

public CommitRequest.Builder mergeSingleUseTransaction(TransactionOptions value)

Execute mutations in a temporary transaction. Note that unlike commit of a previously-started transaction, commit with a temporary transaction is non-idempotent. That is, if the CommitRequest is sent to Cloud Spanner more than once (for instance, due to retries in the application, or in the transport library), it is possible that the mutations are executed more than once. If this is undesirable, use BeginTransaction and Commit instead.

.google.spanner.v1.TransactionOptions single_use_transaction = 3;

Parameter
NameDescription
valueTransactionOptions
Returns
TypeDescription
CommitRequest.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final CommitRequest.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
CommitRequest.Builder
Overrides

removeMutations(int index)

public CommitRequest.Builder removeMutations(int index)

The mutations to be executed when this transaction commits. All mutations are applied atomically, in the order they appear in this list.

repeated .google.spanner.v1.Mutation mutations = 4;

Parameter
NameDescription
indexint
Returns
TypeDescription
CommitRequest.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public CommitRequest.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
CommitRequest.Builder
Overrides

setMutations(int index, Mutation value)

public CommitRequest.Builder setMutations(int index, Mutation value)

The mutations to be executed when this transaction commits. All mutations are applied atomically, in the order they appear in this list.

repeated .google.spanner.v1.Mutation mutations = 4;

Parameters
NameDescription
indexint
valueMutation
Returns
TypeDescription
CommitRequest.Builder

setMutations(int index, Mutation.Builder builderForValue)

public CommitRequest.Builder setMutations(int index, Mutation.Builder builderForValue)

The mutations to be executed when this transaction commits. All mutations are applied atomically, in the order they appear in this list.

repeated .google.spanner.v1.Mutation mutations = 4;

Parameters
NameDescription
indexint
builderForValueMutation.Builder
Returns
TypeDescription
CommitRequest.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public CommitRequest.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
CommitRequest.Builder
Overrides

setRequestOptions(RequestOptions value)

public CommitRequest.Builder setRequestOptions(RequestOptions value)

Common options for this request.

.google.spanner.v1.RequestOptions request_options = 6;

Parameter
NameDescription
valueRequestOptions
Returns
TypeDescription
CommitRequest.Builder

setRequestOptions(RequestOptions.Builder builderForValue)

public CommitRequest.Builder setRequestOptions(RequestOptions.Builder builderForValue)

Common options for this request.

.google.spanner.v1.RequestOptions request_options = 6;

Parameter
NameDescription
builderForValueRequestOptions.Builder
Returns
TypeDescription
CommitRequest.Builder

setReturnCommitStats(boolean value)

public CommitRequest.Builder setReturnCommitStats(boolean value)

If true, then statistics related to the transaction will be included in the CommitResponse. Default value is false.

bool return_commit_stats = 5;

Parameter
NameDescription
valueboolean

The returnCommitStats to set.

Returns
TypeDescription
CommitRequest.Builder

This builder for chaining.

setSession(String value)

public CommitRequest.Builder setSession(String value)

Required. The session in which the transaction to be committed is running.

string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueString

The session to set.

Returns
TypeDescription
CommitRequest.Builder

This builder for chaining.

setSessionBytes(ByteString value)

public CommitRequest.Builder setSessionBytes(ByteString value)

Required. The session in which the transaction to be committed is running.

string session = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueByteString

The bytes for session to set.

Returns
TypeDescription
CommitRequest.Builder

This builder for chaining.

setSingleUseTransaction(TransactionOptions value)

public CommitRequest.Builder setSingleUseTransaction(TransactionOptions value)

Execute mutations in a temporary transaction. Note that unlike commit of a previously-started transaction, commit with a temporary transaction is non-idempotent. That is, if the CommitRequest is sent to Cloud Spanner more than once (for instance, due to retries in the application, or in the transport library), it is possible that the mutations are executed more than once. If this is undesirable, use BeginTransaction and Commit instead.

.google.spanner.v1.TransactionOptions single_use_transaction = 3;

Parameter
NameDescription
valueTransactionOptions
Returns
TypeDescription
CommitRequest.Builder

setSingleUseTransaction(TransactionOptions.Builder builderForValue)

public CommitRequest.Builder setSingleUseTransaction(TransactionOptions.Builder builderForValue)

Execute mutations in a temporary transaction. Note that unlike commit of a previously-started transaction, commit with a temporary transaction is non-idempotent. That is, if the CommitRequest is sent to Cloud Spanner more than once (for instance, due to retries in the application, or in the transport library), it is possible that the mutations are executed more than once. If this is undesirable, use BeginTransaction and Commit instead.

.google.spanner.v1.TransactionOptions single_use_transaction = 3;

Parameter
NameDescription
builderForValueTransactionOptions.Builder
Returns
TypeDescription
CommitRequest.Builder

setTransactionId(ByteString value)

public CommitRequest.Builder setTransactionId(ByteString value)

Commit a previously-started transaction.

bytes transaction_id = 2;

Parameter
NameDescription
valueByteString

The transactionId to set.

Returns
TypeDescription
CommitRequest.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final CommitRequest.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
CommitRequest.Builder
Overrides