Package com.google.cloud.spanner
Interface AsyncTransactionManager.CommitTimestampFuture
- All Superinterfaces:
com.google.api.core.ApiFuture<com.google.cloud.Timestamp>,Future<com.google.cloud.Timestamp>
- Enclosing interface:
- AsyncTransactionManager
public static interface AsyncTransactionManager.CommitTimestampFuture
extends com.google.api.core.ApiFuture<com.google.cloud.Timestamp>
ApiFuture that returns the commit Timestamp of a Cloud Spanner transaction that
is executed using an AsyncTransactionManager. This future is returned by the call to
AsyncTransactionManager.AsyncTransactionStep.commitAsync() of the last step in the transaction.-
Method Summary
Modifier and TypeMethodDescriptioncom.google.cloud.Timestampget()Returns the commit timestamp of the transaction.com.google.cloud.TimestampSame asget(), but will throw aTimeoutExceptionif the transaction does not finish within the timeout.Methods inherited from interface com.google.api.core.ApiFuture
addListenerMethods inherited from interface java.util.concurrent.Future
cancel, isCancelled, isDone
-
Method Details
-
get
Returns the commit timestamp of the transaction. Getting this value should always be done in order to ensure that the transaction succeeded. If any of the steps in the transaction fails with an uncaught exception, this method will automatically stop the transaction at that point and the exception will be returned as the cause of theExecutionExceptionthat is thrown by this method.- Specified by:
getin interfaceFuture<com.google.cloud.Timestamp>- Throws:
AbortedException- if the transaction was aborted by Cloud Spanner and needs to be retried.InterruptedExceptionExecutionException
-
get
com.google.cloud.Timestamp get(long timeout, TimeUnit unit) throws AbortedException, InterruptedException, ExecutionException, TimeoutException Same asget(), but will throw aTimeoutExceptionif the transaction does not finish within the timeout.- Specified by:
getin interfaceFuture<com.google.cloud.Timestamp>- Throws:
AbortedExceptionInterruptedExceptionExecutionExceptionTimeoutException
-