Package com.google.cloud.spanner
Class BatchClientImpl
java.lang.Object
com.google.cloud.spanner.BatchClientImpl
- All Implemented Interfaces:
BatchClient
Default implementation for Batch Client interface.
-
Method Summary
Modifier and TypeMethodDescriptionbatchReadOnlyTransaction(BatchTransactionId batchTransactionId) Returns aBatchReadOnlyTransactioncontext in which multiple reads and/or queries can be performed.Returns aBatchReadOnlyTransactioncontext in which multiple reads and/or queries can be performed.Returns theDatabaseRoleused by the client connection.
-
Method Details
-
getDatabaseRole
Description copied from interface:BatchClientReturns theDatabaseRoleused by the client connection. The database role that is used determines the access permissions that a connection has. This can for example be used to create connections that are only permitted to access certain tables.- Specified by:
getDatabaseRolein interfaceBatchClient
-
batchReadOnlyTransaction
Description copied from interface:BatchClientReturns aBatchReadOnlyTransactioncontext in which multiple reads and/or queries can be performed. All reads/queries will use the same timestamp, and the timestamp can be inspected after this transaction is created successfully. This is a blocking method since it waits to finish the rpcs.Note that the bounded staleness modes,
TimestampBound.Mode.MIN_READ_TIMESTAMPandTimestampBound.Mode.MAX_STALENESS, are not supported forBatchReadOnlyTransaction.- Specified by:
batchReadOnlyTransactionin interfaceBatchClient- Parameters:
bound- the timestamp bound at which to perform the readBatchReadOnlyTransaction txn = batchClient.batchReadOnlyTransaction(TimestampBound.strong());
-
batchReadOnlyTransaction
Description copied from interface:BatchClientReturns aBatchReadOnlyTransactioncontext in which multiple reads and/or queries can be performed. This is a non-blocking method. All reads/queries will use the same timestamp, and the timestamp can be inspected after this transaction is created successfully.This method is useful to recreate a BatchReadOnlyTransaction object from an existing batchTransactionId. For example one might send the transaction id to a different process or machine and recreate the transaction object there.
- Specified by:
batchReadOnlyTransactionin interfaceBatchClient- Parameters:
batchTransactionId- to re-initialize the transaction, re-using the timestamp for successive read/query.
-