java.lang.Object
org.elasticsearch.cluster.ProjectStateObserver
A utility class for interacting with a project state.
Analogous to
ClusterStateObserver but scoped to a single project-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionProjectStateObserver(ProjectState initialState, ClusterService clusterService, TimeValue timeout, org.apache.logging.log4j.Logger logger, ThreadContext contextHolder) -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidObtain the most recentapplied cluster stateand then invoke eitherProjectStateObserver.Listener.onProjectStateChange(ProjectState)orProjectStateObserver.Listener.onProjectMissing(ProjectId, ClusterState)on the providedlistenervoidwaitForNextChange(ProjectStateObserver.Listener listener, TimeValue timeOutValue)
-
Constructor Details
-
ProjectStateObserver
public ProjectStateObserver(ProjectState initialState, ClusterService clusterService, @Nullable TimeValue timeout, org.apache.logging.log4j.Logger logger, ThreadContext contextHolder)
-
-
Method Details
-
waitForNextChange
public void waitForNextChange(ProjectStateObserver.Listener listener, @Nullable TimeValue timeOutValue) -
isTimedOut
public boolean isTimedOut() -
observeLastAppliedState
Obtain the most recentapplied cluster stateand then invoke eitherProjectStateObserver.Listener.onProjectStateChange(ProjectState)orProjectStateObserver.Listener.onProjectMissing(ProjectId, ClusterState)on the providedlistener
-