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 commitTimestamp
of a Cloud Spanner transaction that is executed using anAsyncTransactionManager
. This future is returned by the call toAsyncTransactionManager.AsyncTransactionStep.commitAsync()
of the last step in the transaction.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description com.google.cloud.Timestamp
get()
Returns the commit timestamp of the transaction.com.google.cloud.Timestamp
get(long timeout, TimeUnit unit)
Same asget()
, but will throw aTimeoutException
if the transaction does not finish within the timeout.-
Methods inherited from interface java.util.concurrent.Future
cancel, isCancelled, isDone
-
-
-
-
Method Detail
-
get
com.google.cloud.Timestamp get() throws AbortedException, InterruptedException, ExecutionException
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
-
-