Package org.apache.hadoop.hbase.client
Class HBaseAdmin.ProcedureFuture<V>
java.lang.Object
org.apache.hadoop.hbase.client.HBaseAdmin.ProcedureFuture<V>
- All Implemented Interfaces:
Future<V>
- Direct Known Subclasses:
HBaseAdmin.AbortProcedureFuture
,HBaseAdmin.NamespaceFuture
,HBaseAdmin.ReplicationFuture
,HBaseAdmin.TableFuture
- Enclosing class:
- HBaseAdmin
@Private
@Evolving
protected static class HBaseAdmin.ProcedureFuture<V>
extends Object
implements Future<V>
Future that waits on a procedure result. Returned by the async version of the Admin calls, and
used internally by the sync calls to wait on the result of the procedure.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static interface
-
Field Summary
Modifier and TypeFieldDescriptionprivate final HBaseAdmin
private boolean
private boolean
private ExecutionException
protected final Long
private boolean
private V
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.AbortProcedureResponse
abortProcedureResult
(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.AbortProcedureRequest request) boolean
cancel
(boolean mayInterruptIfRunning) protected V
convertResult
(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.GetProcedureResultResponse response) Convert the procedure result response to a specified type.get()
protected HBaseAdmin
getAdmin()
protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.GetProcedureResultResponse
getProcedureResult
(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.GetProcedureResultRequest request) boolean
boolean
isDone()
protected V
postOperationFailure
(IOException exception, long deadlineTs) Called after the operation is terminated with a failure.protected V
postOperationResult
(V result, long deadlineTs) Called after the operation is completed and the result fetched.private static IOException
protected void
waitForState
(long deadlineTs, HBaseAdmin.ProcedureFuture.WaitForStateCallable callable) protected V
waitOperationResult
(long deadlineTs) Fallback implementation in case the procedure is not supported by the server.private V
waitProcedureResult
(long procId, long deadlineTs)
-
Field Details
-
exception
-
procResultFound
-
done
-
cancelled
-
result
-
admin
-
procId
-
-
Constructor Details
-
ProcedureFuture
-
-
Method Details
-
cancel
-
isCancelled
- Specified by:
isCancelled
in interfaceFuture<V>
-
abortProcedureResult
protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.AbortProcedureResponse abortProcedureResult(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.AbortProcedureRequest request) throws IOException - Throws:
IOException
-
get
- Specified by:
get
in interfaceFuture<V>
- Throws:
InterruptedException
ExecutionException
-
get
public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
get
in interfaceFuture<V>
- Throws:
InterruptedException
ExecutionException
TimeoutException
-
isDone
-
getAdmin
-
waitProcedureResult
private V waitProcedureResult(long procId, long deadlineTs) throws IOException, TimeoutException, InterruptedException -
unwrapException
-
getProcedureResult
protected org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.GetProcedureResultResponse getProcedureResult(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.GetProcedureResultRequest request) throws IOException - Throws:
IOException
-
convertResult
protected V convertResult(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.GetProcedureResultResponse response) throws IOException Convert the procedure result response to a specified type.- Parameters:
response
- the procedure result object to parse- Returns:
- the result data of the procedure.
- Throws:
IOException
-
waitOperationResult
Fallback implementation in case the procedure is not supported by the server. It should try to wait until the operation is completed.- Parameters:
deadlineTs
- the timestamp after which this method should throw a TimeoutException- Returns:
- the result data of the operation
- Throws:
IOException
TimeoutException
-
postOperationResult
Called after the operation is completed and the result fetched. this allows to perform extra steps after the procedure is completed. it allows to apply transformations to the result that will be returned by get().- Parameters:
result
- the result of the proceduredeadlineTs
- the timestamp after which this method should throw a TimeoutException- Returns:
- the result of the procedure, which may be the same as the passed one
- Throws:
IOException
TimeoutException
-
postOperationFailure
protected V postOperationFailure(IOException exception, long deadlineTs) throws IOException, TimeoutException Called after the operation is terminated with a failure. this allows to perform extra steps after the procedure is terminated. it allows to apply transformations to the result that will be returned by get(). The default implementation will rethrow the exception- Parameters:
exception
- the exception got from fetching the resultdeadlineTs
- the timestamp after which this method should throw a TimeoutException- Returns:
- the result of the procedure, which may be the same as the passed one
- Throws:
IOException
TimeoutException
-
waitForState
protected void waitForState(long deadlineTs, HBaseAdmin.ProcedureFuture.WaitForStateCallable callable) throws IOException, TimeoutException - Throws:
IOException
TimeoutException
-