Interface ClusterApplier
- All Known Implementing Classes:
ClusterApplierService
public interface ClusterApplier
-
Method Summary
Modifier and TypeMethodDescriptiongetStats()
void
onNewClusterState
(String source, Supplier<ClusterState> clusterStateSupplier, ActionListener<Void> listener) Method to invoke when a new cluster state is available to be appliedvoid
setInitialState
(ClusterState initialState) Sets the initial state for this applier.
-
Method Details
-
setInitialState
Sets the initial state for this applier. Should only be called once.- Parameters:
initialState
- the initial state to set
-
onNewClusterState
void onNewClusterState(String source, Supplier<ClusterState> clusterStateSupplier, ActionListener<Void> listener) Method to invoke when a new cluster state is available to be applied- Parameters:
source
- information where the cluster state came fromclusterStateSupplier
- the cluster state supplier which provides the latest cluster state to applylistener
- notified after cluster state is applied. The implementation must not throw exceptions: an exception thrown by this listener is logged by the cluster applier service atERROR
level and otherwise ignored, except in tests where it raises anAssertionError
. If log-and-ignore is the right behaviour then implementations must do so themselves, typically using a more specific logger and at a less dramatic log level.
-
getStats
ClusterApplierRecordingService.Stats getStats()
-