Class JoinValidationService
When a node requests to join an existing cluster, the master first sends it a copy of a recent cluster state to ensure that the new node can make sense of it (e.g. it has all the plugins it needs to even deserialize the state). Cluster states can be expensive to serialize: they are large, so we compress them, but the compression takes extra CPU. Also there may be many nodes all joining at once (e.g. after a full cluster restart or the healing of a large network partition). This component caches the serialized and compressed state that was sent to one joining node and reuses it to validate other join requests that arrive within the cache timeout, avoiding the need to allocate memory for each request and repeat all that serialization and compression work each time.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJoinValidationService
(Settings settings, TransportService transportService, Supplier<ClusterState> clusterStateSupplier, Collection<BiConsumer<DiscoveryNode, ClusterState>> joinValidators) -
Method Summary
Modifier and TypeMethodDescriptionvoid
stop()
void
validateJoin
(DiscoveryNode discoveryNode, ActionListener<TransportResponse.Empty> listener)
-
Field Details
-
JOIN_VALIDATE_ACTION_NAME
- See Also:
-
JOIN_VALIDATION_CACHE_TIMEOUT_SETTING
-
-
Constructor Details
-
JoinValidationService
public JoinValidationService(Settings settings, TransportService transportService, Supplier<ClusterState> clusterStateSupplier, Collection<BiConsumer<DiscoveryNode, ClusterState>> joinValidators)
-
-
Method Details
-
validateJoin
public void validateJoin(DiscoveryNode discoveryNode, ActionListener<TransportResponse.Empty> listener) -
stop
public void stop()
-