Class SupervisorStateManager
- java.lang.Object
-
- org.apache.druid.indexing.overlord.supervisor.SupervisorStateManager
-
public class SupervisorStateManager extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSupervisorStateManager.BasicStatestatic classSupervisorStateManager.ExceptionEventstatic interfaceSupervisorStateManager.State
-
Constructor Summary
Constructors Constructor Description SupervisorStateManager(SupervisorStateManagerConfig supervisorStateManagerConfig, boolean suspended)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SupervisorStateManager.ExceptionEventbuildExceptionEvent(Throwable t)List<SupervisorStateManager.ExceptionEvent>getExceptionEvents()protected Deque<SupervisorStateManager.ExceptionEvent>getRecentEventsQueue()protected SupervisorStateManager.StategetSpecificUnhealthySupervisorState()SupervisorStateManager.StategetSupervisorState()booleanisAtLeastOneSuccessfulRun()booleanisHealthy()booleanisIdle()booleanisSteadyState()protected booleanisStoreStackTrace()voidmarkRunFinished()voidmaybeSetState(SupervisorStateManager.State proposedState)Certain states are only valid if the supervisor hasn't had a successful iteration.voidrecordCompletedTaskState(org.apache.druid.indexer.TaskState state)voidrecordThrowableEvent(Throwable t)
-
-
-
Constructor Detail
-
SupervisorStateManager
public SupervisorStateManager(SupervisorStateManagerConfig supervisorStateManagerConfig, boolean suspended)
-
-
Method Detail
-
maybeSetState
public void maybeSetState(SupervisorStateManager.State proposedState)
Certain states are only valid if the supervisor hasn't had a successful iteration. This method checks if there's been at least one successful iteration, and if applicable, sets supervisor state to an appropriate new state. A STOPPING supervisor cannot transition to any other state as this state is final. This method must be thread-safe as multiple threads trying to update may lead to an invalid state.
-
recordThrowableEvent
public void recordThrowableEvent(Throwable t)
-
recordCompletedTaskState
public void recordCompletedTaskState(org.apache.druid.indexer.TaskState state)
-
markRunFinished
public void markRunFinished()
-
getExceptionEvents
public List<SupervisorStateManager.ExceptionEvent> getExceptionEvents()
-
getSupervisorState
public SupervisorStateManager.State getSupervisorState()
-
isHealthy
public boolean isHealthy()
-
isSteadyState
public boolean isSteadyState()
-
isAtLeastOneSuccessfulRun
public boolean isAtLeastOneSuccessfulRun()
-
isIdle
public boolean isIdle()
-
getRecentEventsQueue
protected Deque<SupervisorStateManager.ExceptionEvent> getRecentEventsQueue()
-
isStoreStackTrace
protected boolean isStoreStackTrace()
-
getSpecificUnhealthySupervisorState
protected SupervisorStateManager.State getSpecificUnhealthySupervisorState()
-
buildExceptionEvent
protected SupervisorStateManager.ExceptionEvent buildExceptionEvent(Throwable t)
-
-