Class Operation<R,M> (6.57.0)

public class Operation<R,M>

Represents a long-running operation.

Inheritance

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

Type Parameters

NameDescription
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
TypeDescription
M

getName()

public String getName()

Returns the name of the operation.

Returns
TypeDescription
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
TypeDescription
R
Exceptions
TypeDescription
SpannerException

if the operation failed.

isDone()

public boolean isDone()

Returns true if the operation is done.

Returns
TypeDescription
boolean

isSuccessful()

public boolean isSuccessful()

Returns true if the operation completed successfully.

Returns
TypeDescription
boolean

reload()

public Operation<R,M> reload()

Fetches the current status of this operation.

Returns
TypeDescription
Operation<R,M>
Exceptions
TypeDescription
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
NameDescription
waitOptionsRetryOption[]
Returns
TypeDescription
Operation<R,M>

null if operation is not found otherwise the current operation.

Exceptions
TypeDescription
SpannerException