Class Operation<R,M> (6.74.0)

public class Operation<R,M>

Represents a long-running operation.

Inheritance

java.lang.Object > Operation<R,M>

Type Parameters

Name Description
R
M

Methods

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.

Returns
Type Description
M

getName()

public String getName()

Returns the name of the operation.

Returns
Type Description
String

getResult()

public R 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.

Returns
Type Description
R
Exceptions
Type Description
SpannerException

if the operation failed.

isDone()

public boolean isDone()

Returns true if the operation is done.

Returns
Type Description
boolean

isSuccessful()

public boolean isSuccessful()

Returns true if the operation completed successfully.

Returns
Type Description
boolean

reload()

public Operation<R,M> reload()

Fetches the current status of this operation.

Returns
Type Description
Operation<R,M>
Exceptions
Type Description
SpannerException

waitFor(RetryOption[] waitOptions)

public Operation<R,M> waitFor(RetryOption[] waitOptions)

Blocks till the operation is complete or maximum time, if specified, has elapsed.

Parameter
Name Description
waitOptions RetryOption[]
Returns
Type Description
Operation<R,M>

null if operation is not found otherwise the current operation.

Exceptions
Type Description
SpannerException