Class InitDatanodeState
java.lang.Object
org.apache.hadoop.ozone.container.common.states.datanode.InitDatanodeState
- All Implemented Interfaces:
Callable<DatanodeStateMachine.DatanodeStates>,DatanodeState
public class InitDatanodeState
extends Object
implements DatanodeState, Callable<DatanodeStateMachine.DatanodeStates>
Init Datanode State is the task that gets run when we are in Init State.
-
Constructor Summary
ConstructorsConstructorDescriptionInitDatanodeState(org.apache.hadoop.hdds.conf.ConfigurationSource conf, SCMConnectionManager connectionManager, StateContext context) Create InitDatanodeState Task. -
Method Summary
Modifier and TypeMethodDescriptionWait for execute to finish.call()Computes a result, or throws an exception if unable to do so.voidexecute(ExecutorService executor) Executes one or more tasks that is needed by this state.voidonEnter()Called before entering this state.voidonExit()Called After exiting this state.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.ozone.container.common.states.DatanodeState
clear
-
Constructor Details
-
InitDatanodeState
public InitDatanodeState(org.apache.hadoop.hdds.conf.ConfigurationSource conf, SCMConnectionManager connectionManager, StateContext context) Create InitDatanodeState Task.- Parameters:
conf- - ConfconnectionManager- - Connection Managercontext- - Current Context
-
-
Method Details
-
call
Computes a result, or throws an exception if unable to do so.- Specified by:
callin interfaceCallable<DatanodeStateMachine.DatanodeStates>- Returns:
- computed result
- Throws:
Exception- if unable to compute a result
-
onEnter
public void onEnter()Called before entering this state.- Specified by:
onEnterin interfaceDatanodeState
-
onExit
public void onExit()Called After exiting this state.- Specified by:
onExitin interfaceDatanodeState
-
execute
Executes one or more tasks that is needed by this state.- Specified by:
executein interfaceDatanodeState- Parameters:
executor- - ExecutorService
-
await
public DatanodeStateMachine.DatanodeStates await(long time, TimeUnit timeUnit) throws InterruptedException, ExecutionException, TimeoutException Wait for execute to finish.- Specified by:
awaitin interfaceDatanodeState- Parameters:
time- - TimetimeUnit- - Unit of time.- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-