Interface DatanodeState<T>
- All Known Implementing Classes:
InitDatanodeState,RunningDatanodeState
public interface DatanodeState<T>
State Interface that allows tasks to maintain states.
-
Method Summary
Modifier and TypeMethodDescriptionWait for execute to finish.default voidclear()Clean up some resources.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.
-
Method Details
-
onEnter
void onEnter()Called before entering this state. -
onExit
void onExit()Called After exiting this state. -
execute
Executes one or more tasks that is needed by this state.- Parameters:
executor- - ExecutorService
-
await
T await(long time, TimeUnit timeUnit) throws InterruptedException, ExecutionException, TimeoutException Wait for execute to finish.- Parameters:
time- - TimetimeUnit- - Unit of time.- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-
clear
default void clear()Clean up some resources.
-