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<?>> clusterHandlerList, List<ReservedProjectStateHandler<?>> projectHandlerList) Controller class for saving and reservingClusterState
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
initEmpty
(String namespace, ActionListener<ActionResponse.Empty> listener) void
Adds additionalReservedClusterStateHandler
to the handler registryvoid
Adds additionalReservedClusterStateHandler
to the handler registryparse
(ProjectId projectId, String namespace, XContentParser parser) 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
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
void
process
(ProjectId projectId, String namespace, List<ReservedStateChunk> reservedStateChunks, ReservedStateVersionCheck versionCheck, Consumer<Exception> errorListener) Saves and reserves a chunk of the cluster state under a given 'namespace' fromXContentParser
by combining several chunks into onevoid
process
(ProjectId projectId, 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
(ProjectId projectId, String namespace, XContentParser parser, ReservedStateVersionCheck versionCheck, Consumer<Exception> errorListener) Saves and reserves a chunk of the project state under a given 'namespace' fromXContentParser
-
Field Details
-
STATE_FIELD
-
METADATA_FIELD
-
-
Constructor Details
-
ReservedClusterStateService
public ReservedClusterStateService(ClusterService clusterService, RerouteService rerouteService, List<ReservedClusterStateHandler<?>> clusterHandlerList, List<ReservedProjectStateHandler<?>> projectHandlerList) Controller class for saving and reservingClusterState
.
-
-
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.
-
parse
-
process
public void process(ProjectId projectId, String namespace, XContentParser parser, ReservedStateVersionCheck versionCheck, Consumer<Exception> errorListener) Saves and reserves a chunk of the project state under a given 'namespace' fromXContentParser
- Parameters:
projectId
- the project this state is fornamespace
- the namespace under which we'll store the reserved keys in the project 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.
-
process
public void process(ProjectId projectId, String namespace, ReservedStateChunk reservedStateChunk, ReservedStateVersionCheck versionCheck, Consumer<Exception> errorListener) Saves and reserves a chunk of the cluster state under a given 'namespace' fromXContentParser
- Parameters:
projectId
- the project state to modifynamespace
- the namespace under which we'll store the reserved keys in the cluster state metadatareservedStateChunk
- aReservedStateChunk
composite state object to processversionCheck
- Enum representing whether a reserved state should be processed based on the current and new versionserrorListener
- 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.
-
process
public void process(ProjectId projectId, String namespace, List<ReservedStateChunk> reservedStateChunks, ReservedStateVersionCheck versionCheck, Consumer<Exception> errorListener) Saves and reserves a chunk of the cluster state under a given 'namespace' fromXContentParser
by combining several chunks into one- Parameters:
projectId
- the project state to modifynamespace
- the namespace under which we'll store the reserved keys in the cluster state metadatareservedStateChunks
- a list ofReservedStateChunk
composite state objects to processversionCheck
- Enum representing whether a reserved state should be processed based on the current and new versionserrorListener
- 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.
-
installClusterStateHandler
Adds additionalReservedClusterStateHandler
to the handler registry- Parameters:
handler
- an additional reserved state handler to be added
-
installProjectStateHandler
Adds additionalReservedClusterStateHandler
to the handler registry- Parameters:
handler
- an additional reserved state handler to be added
-