public final class Options implements Serializable
Specifies options for various spanner operations
Static Methods
bufferRows(int bufferRows)
public static Options.ReadAndQueryOption bufferRows(int bufferRows)
Parameter |
Name |
Description |
bufferRows |
int
|
commitStats()
public static Options.TransactionOption commitStats()
Specifying this instructs the transaction to request CommitStats from the backend.
dataBoostEnabled(Boolean dataBoostEnabled)
public static Options.DataBoostQueryOption dataBoostEnabled(Boolean dataBoostEnabled)
If this is for PartitionedRead or PartitionedQuery and this field is set to true
, the request
will be executed via Spanner independent compute resources.
Parameter |
Name |
Description |
dataBoostEnabled |
Boolean
|
Returns |
Type |
Description |
com.google.cloud.spanner.Options.DataBoostQueryOption |
|
decodeMode(DecodeMode decodeMode)
public static Options.ReadAndQueryOption decodeMode(DecodeMode decodeMode)
directedRead(DirectedReadOptions directedReadOptions)
public static Options.ReadAndQueryOption directedRead(DirectedReadOptions directedReadOptions)
Option to request DirectedRead for ReadOnlyTransaction and SingleUseTransaction.
The DirectedReadOptions can be used to indicate which replicas or regions should be used for
non-transactional reads or queries. Not all requests can be sent to non-leader replicas. In
particular, some requests such as reads within read-write transactions must be sent to a
designated leader replica. These requests ignore DirectedReadOptions.
etag(String etag)
public static Options.DeleteAdminApiOption etag(String etag)
Specifying this will help in optimistic concurrency control as a way to help prevent
simultaneous deletes of an instance config from overwriting each other. Operations that support
this option are:
Parameter |
Name |
Description |
etag |
String
|
excludeTxnFromChangeStreams()
public static Options.UpdateTransactionOption excludeTxnFromChangeStreams()
Specifying this instructs the transaction to be excluded from being recorded in change streams
with the DDL option allow_txn_exclusion=true
. This does not exclude the transaction from
being recorded in the change streams with the DDL option allow_txn_exclusion
being false or
unset.
filter(String filter)
public static Options.ListOption filter(String filter)
Specifying this will cause the given filter to be applied to the list operation. List
operations that support this options are:
If this option is passed to any other list operation, it will throw an
IllegalArgumentException.
Parameter |
Name |
Description |
filter |
String
An expression for filtering the results of the request. Filter rules are case
insensitive. Some examples of using filters are:
- name:* The entity has a name.
- name:Howl The entity's name contains "howl".
- name:HOWL Equivalent to above.
- NAME:howl Equivalent to above.
- labels.env:* The entity has the label env.
- labels.env:dev The entity has a label env whose value contains "dev".
- name:howl labels.env:dev The entity's name contains "howl" and it has the label env
whose value contains "dev".
|
limit(long limit)
public static Options.ReadOption limit(long limit)
Specifying this will cause the read to yield at most this many rows. This should be greater
than 0.
Parameter |
Name |
Description |
limit |
long
|
maxCommitDelay(Duration maxCommitDelay)
public static Options.TransactionOption maxCommitDelay(Duration maxCommitDelay)
Parameter |
Name |
Description |
maxCommitDelay |
Duration
|
optimisticLock()
public static Options.TransactionOption optimisticLock()
Specifying this instructs the transaction to request Optimistic Lock from the backend. In this
concurrency mode, operations during the execution phase, i.e., reads and queries, are performed
without acquiring locks, and transactional consistency is ensured by running a validation
process in the commit phase (when any needed locks are acquired). The validation process
succeeds only if there are no conflicting committed transactions (that committed mutations to
the read data at a commit timestamp after the read timestamp).
orderBy(Options.RpcOrderBy orderBy)
public static Options.ReadOption orderBy(Options.RpcOrderBy orderBy)
Specifies the order_by to use for the RPC.
Parameter |
Name |
Description |
orderBy |
Opt |