Class TransactionOptions.ReadWriteOptionsBuilder (3.16.3)

public static final class TransactionOptions.ReadWriteOptionsBuilder extends TransactionOptions.Builder<TransactionOptions.ReadWriteOptionsBuilder>

A typesafe builder class representing those options that are applicable when configuring a transaction to be read-write. All methods function as "set" rather than returning a new copy with a value set on it. By default, a read-write transaction will be attempted a max of 5 times.

Inheritance

java.lang.Object > TransactionOptions.Builder > TransactionOptions.ReadWriteOptionsBuilder

Methods

build()

public TransactionOptions build()
Returns
TypeDescription
TransactionOptions
Overrides

getNumberOfAttempts()

public int getNumberOfAttempts()

Specify the max number of attempts a transaction will be attempted before resulting in an error.

Returns
TypeDescription
int

The max number of attempts to try and commit the transaction.

setNumberOfAttempts(int numberOfAttempts)

public TransactionOptions.ReadWriteOptionsBuilder setNumberOfAttempts(int numberOfAttempts)

Specify the max number of attempts a transaction will be attempted before resulting in an error.

Parameter
NameDescription
numberOfAttemptsint

The max number of attempts to try and commit the transaction.

Returns
TypeDescription
TransactionOptions.ReadWriteOptionsBuilder

this builder