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.Timestamp
get()
Returns the commit timestamp of the transaction.com.google.cloud.Timestamp
Same asget()
, but will throw aTimeoutException
if the transaction does not finish within the timeout.Methods inherited from interface com.google.api.core.ApiFuture
addListener
Methods 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 theExecutionException
that is thrown by this method.- Specified by:
get
in interfaceFuture<com.google.cloud.Timestamp>
- Throws:
AbortedException
- if the transaction was aborted by Cloud Spanner and needs to be retried.InterruptedException
ExecutionException
-
get
com.google.cloud.Timestamp get(long timeout, TimeUnit unit) throws AbortedException, InterruptedException, ExecutionException, TimeoutException Same asget()
, but will throw aTimeoutException
if the transaction does not finish within the timeout.- Specified by:
get
in interfaceFuture<com.google.cloud.Timestamp>
- Throws:
AbortedException
InterruptedException
ExecutionException
TimeoutException
-