Package com.google.cloud.spanner
Class Operation<R,M>
java.lang.Object
com.google.cloud.spanner.Operation<R,M>
- Type Parameters:
R
-M
-
Represents a long-running operation.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the metadata returned by the last refresh of this operation.getName()
Returns the name of the operation.Returns result of the operation if the operation is complete and had a result.boolean
isDone()
Returns true if the operation is done.boolean
Returns true if the operation completed successfully.reload()
Fetches the current status of this operation.waitFor
(com.google.cloud.RetryOption... waitOptions) Blocks till the operation is complete or maximum time, if specified, has elapsed.
-
Method Details
-
reload
Fetches the current status of this operation.- Throws:
SpannerException
-
waitFor
Blocks till the operation is complete or maximum time, if specified, has elapsed.- Returns:
- null if operation is not found otherwise the current operation.
- Throws:
SpannerException
-
getMetadata
Returns the metadata returned by the last refresh of this operation. Returns null if no metadata was returned or if this operation has not been refreshed. -
isDone
public boolean isDone()Returns true if the operation is done. -
getResult
Returns result of the operation if the operation is complete and had a result. Returns null if the operation is not complete or did not have a result.- Throws:
SpannerException
- if the operation failed.
-
getName
Returns the name of the operation. -
isSuccessful
public boolean isSuccessful()Returns true if the operation completed successfully.
-