Module org.elasticsearch.server
Class ReservedClusterStateService
java.lang.Object
org.elasticsearch.reservedstate.service.ReservedClusterStateService
Controller class for storing and reserving a portion of the
ClusterState
This class contains the logic about validation, ordering and applying of the cluster state specified in a file or through plugins/modules. Reserved cluster state cannot be modified through the REST APIs, only through this controller class.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionReservedClusterStateService
(ClusterService clusterService, RerouteService rerouteService, List<ReservedClusterStateHandler<?>> handlerList) Controller class for saving and reservingClusterState
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
initEmpty
(String namespace, ActionListener<ActionResponse.Empty> listener) void
installStateHandler
(ReservedClusterStateHandler<?> handler) Adds additionalReservedClusterStateHandler
to the handler registryvoid
process
(String namespace, ReservedStateChunk reservedStateChunk, ReservedStateVersionCheck versionCheck, Consumer<Exception> errorListener) Saves and reserves a chunk of the cluster state under a given 'namespace' fromXContentParser
void
process
(String namespace, XContentParser parser, ReservedStateVersionCheck versionCheck, Consumer<Exception> errorListener) Saves and reserves a chunk of the cluster state under a given 'namespace' fromXContentParser
-
Field Details
-
STATE_FIELD
-
METADATA_FIELD
-
-
Constructor Details
-
ReservedClusterStateService
public ReservedClusterStateService(ClusterService clusterService, RerouteService rerouteService, List<ReservedClusterStateHandler<?>> handlerList) Controller class for saving and reservingClusterState
.- Parameters:
clusterService
- for fetching and saving the modified statehandlerList
- a list of reserved state handlers, which we use to transform the state
-
-
Method Details
-
process
public void process(String namespace, XContentParser parser, ReservedStateVersionCheck versionCheck, Consumer<Exception> errorListener) Saves and reserves a chunk of the cluster state under a given 'namespace' fromXContentParser
- Parameters:
namespace
- the namespace under which we'll store the reserved keys in the cluster state metadataparser
- the XContentParser to processversionCheck
- determines if current and new versions of reserved state require processing or should be skippederrorListener
- a consumer called withIllegalStateException
if the content has errors and the cluster state cannot be correctly applied, null if successful or state couldn't be applied because of incompatible version.
-
initEmpty
-
process
public void process(String namespace, ReservedStateChunk reservedStateChunk, ReservedStateVersionCheck versionCheck, Consumer<Exception> errorListener) Saves and reserves a chunk of the cluster state under a given 'namespace' fromXContentParser
- Parameters:
namespace
- the namespace under which we'll store the reserved keys in the cluster state metadatareservedStateChunk
- aReservedStateChunk
composite state object to processerrorListener
- a consumer called withIllegalStateException
if the content has errors and the cluster state cannot be correctly applied, null if successful or the state failed to apply because of incompatible version.
-
installStateHandler
Adds additionalReservedClusterStateHandler
to the handler registry- Parameters:
handler
- an additional reserved state handler to be added
-