Class CommitRequest (6.82.0)

public final class CommitRequest extends GeneratedMessageV3 implements CommitRequestOrBuilder

The request for Commit.

Protobuf type google.spanner.v1.CommitRequest

Static Fields

MAX_COMMIT_DELAY_FIELD_NUMBER

public static final int MAX_COMMIT_DELAY_FIELD_NUMBER
Field Value
Type Description
int

MUTATIONS_FIELD_NUMBER

public static final int MUTATIONS_FIELD_NUMBER
Field Value
Type Description
int

PRECOMMIT_TOKEN_FIELD_NUMBER

public static final int PRECOMMIT_TOKEN_FIELD_NUMBER
Field Value
Type Description
int

REQUEST_OPTIONS_FIELD_NUMBER

public static final int REQUEST_OPTIONS_FIELD_NUMBER
Field Value
Type Description
int

RETURN_COMMIT_STATS_FIELD_NUMBER

public static final int RETURN_COMMIT_STATS_FIELD_NUMBER
Field Value
Type Description
int

SESSION_FIELD_NUMBER

public static final int SESSION_FIELD_NUMBER
Field Value
Type Description
int

SINGLE_USE_TRANSACTION_FIELD_NUMBER

public static final int SINGLE_USE_TRANSACTION_FIELD_NUMBER
Field Value
Type Description
int

TRANSACTION_ID_FIELD_NUMBER

public static final int TRANSACTION_ID_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static CommitRequest getDefaultInstance()
Returns
Type Description
CommitRequest

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static CommitRequest.Builder newBuilder()
Returns
Type Description
CommitRequest.Builder

newBuilder(CommitRequest prototype)

public static CommitRequest.Builder newBuilder(CommitRequest prototype)
Parameter
Name Description
prototype CommitRequest
Returns
Type Description
CommitRequest.Builder

parseDelimitedFrom(InputStream input)

public static CommitRequest parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
CommitRequest
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CommitRequest parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CommitRequest
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static CommitRequest parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
CommitRequest
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static CommitRequest parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CommitRequest
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static CommitRequest parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
CommitRequest
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static CommitRequest parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CommitRequest
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static CommitRequest parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
CommitRequest
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static CommitRequest parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CommitRequest
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static CommitRequest parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
CommitRequest
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CommitRequest parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CommitRequest
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static CommitRequest parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
CommitRequest
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static CommitRequest parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CommitRequest
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<CommitRequest> parser()
Returns
Type Description
Parser<CommitRequest>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

public CommitRequest getDefaultInstanceForType()
Returns
Type Description
CommitRequest

getMaxCommitDelay()

public Duration getMaxCommitDelay()

Optional. The amount of latency this request is willing to incur in order to improve throughput. If this field is not set, Spanner assumes requests are relatively latency sensitive and automatically determines an appropriate delay time. You can specify a batching delay value between 0 and 500 ms.

.google.protobuf.Duration max_commit_delay = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Duration

The maxCommitDelay.

getMaxCommitDelayOrBuilder()

public DurationOrBuilder getMaxCommitDelayOrBuilder()

Optional. The amount of latency this request is willing to incur in order to improve throughput. If this field is not set, Spanner assumes requests are relatively latency sensitive and automatically determines an appropriate delay time. You can specify a batching delay value between 0 and 500 ms.

.google.protobuf.Duration max_commit_delay = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
DurationOrBuilder

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
Name Description
index int
Returns
Type Description
Mutation

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
Type Description
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
Type Description
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
Name Description
index int
Returns
Type Description
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
Type Description
List<? extends com.google.spanner.v1.MutationOrBuilder>

getParserForType()

public Parser<CommitRequest> getParserForType()
Returns
Type Description
Parser<CommitRequest>
Overrides

getPrecommitToken()

public MultiplexedSessionPrecommitToken getPrecommitToken()

Optional. If the read-write transaction was executed on a multiplexed session, the precommit token with the highest sequence number received in this transaction attempt, should be included here. Failing to do so will result in a FailedPrecondition error. This feature is not yet supported and will result in an UNIMPLEMENTED error.

.google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 9 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
MultiplexedSessionPrecommitToken

The precommitToken.

getPrecommitTokenOrBuilder()

public MultiplexedSessionPrecommitTokenOrBuilder getPrecommitTokenOrBuilder()

Optional. If the read-write transaction was executed on a multiplexed session, the precommit token with the highest sequence number received in this transaction attempt, should be included here. Failing to do so will result in a FailedPrecondition error. This feature is not yet supported and will result in an UNIMPLEMENTED error.

.google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 9 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
MultiplexedSessionPrecommitTokenOrBuilder

getRequestOptions()

public RequestOptions getRequestOptions()

Common options for this request.

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

Returns
Type Description
RequestOptions

The requestOptions.

getRequestOptionsOrBuilder()

public RequestOptionsOrBuilder getRequestOptionsOrBuilder()

Common options for this request.

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

Returns
Type Description
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
Type Description
boolean

The returnCommitStats.

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

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
Type Description
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
Type Description
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
Type Description
TransactionOptions

The singleUseTransaction.

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
Type Description
TransactionOptionsOrBuilder

getTransactionCase()

public CommitRequest.TransactionCase getTransactionCase()
Returns
Type Description
CommitRequest.TransactionCase

getTransactionId()

public ByteString getTransactionId()

Commit a previously-started transaction.

bytes transaction_id = 2;

Returns
Type Description
ByteString

The transactionId.

hasMaxCommitDelay()

public boolean hasMaxCommitDelay()

Optional. The amount of latency this request is willing to incur in order to improve throughput. If this field is not set, Spanner assumes requests are relatively latency sensitive and automatically determines an appropriate delay time. You can specify a batching delay value between 0 and 500 ms.

.google.protobuf.Duration max_commit_delay = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the maxCommitDelay field is set.

hasPrecommitToken()

public boolean hasPrecommitToken()

Optional. If the read-write transaction was executed on a multiplexed session, the precommit token with the highest sequence number received in this transaction attempt, should be included here. Failing to do so will result in a FailedPrecondition error. This feature is not yet supported and will result in an UNIMPLEMENTED error.

.google.spanner.v1.MultiplexedSessionPrecommitToken precommit_token = 9 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the precommitToken field is set.

hasRequestOptions()

public boolean hasRequestOptions()

Common options for this request.

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

Returns
Type Description
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
Type Description
boolean

Whether the singleUseTransaction field is set.

hasTransactionId()

public boolean hasTransactionId()

Commit a previously-started transaction.

bytes transaction_id = 2;

Returns
Type Description
boolean

Whether the transactionId field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public CommitRequest.Builder newBuilderForType()
Returns
Type Description
CommitRequest.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected CommitRequest.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
CommitRequest.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public CommitRequest.Builder toBuilder()
Returns
Type Description
CommitRequest.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException