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.ReadWriteOptionsBuilderMethods
build()
public TransactionOptions build()
Returns | |
---|---|
Type | Description |
TransactionOptions |
getNumberOfAttempts()
public int getNumberOfAttempts()
Specify the max number of attempts a transaction will be attempted before resulting in an error.
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
numberOfAttempts | int The max number of attempts to try and commit the transaction. |
Returns | |
---|---|
Type | Description |
TransactionOptions.ReadWriteOptionsBuilder |
|