Class Operation<R,​M>


  • public class Operation<R,​M>
    extends Object
    Represents a long running operation.
    • Method Detail

      • waitFor

        public Operation<R,​M> waitFor​(com.google.cloud.RetryOption... waitOptions)
                                     throws SpannerException
        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

        public M 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

        public R getResult()
                    throws SpannerException
        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

        public String getName()
        Returns the name of the operation.
      • isSuccessful

        public boolean isSuccessful()
        Returns true if the operation completed successfully.