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>ApiFuturethat returns the commitTimestampof 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.Timestampget()Returns the commit timestamp of the transaction.com.google.cloud.Timestampget(long timeout, TimeUnit unit)Same asget(), but will throw aTimeoutExceptionif 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, ExecutionExceptionReturns 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, TimeoutExceptionSame asget(), but will throw aTimeoutExceptionif the transaction does not finish within the timeout.- Specified by:
getin interfaceFuture<com.google.cloud.Timestamp>- Throws:
AbortedExceptionInterruptedExceptionExecutionExceptionTimeoutException
-
-