|
@@ -108,7 +108,6 @@ import org.elasticsearch.health.metadata.HealthMetadataService;
|
|
|
import org.elasticsearch.health.node.DiskHealthIndicatorService;
|
|
|
import org.elasticsearch.health.node.HealthInfoCache;
|
|
|
import org.elasticsearch.health.node.LocalHealthMonitor;
|
|
|
-import org.elasticsearch.health.node.selection.HealthNode;
|
|
|
import org.elasticsearch.health.node.selection.HealthNodeTaskExecutor;
|
|
|
import org.elasticsearch.http.HttpServerTransport;
|
|
|
import org.elasticsearch.index.IndexSettingProvider;
|
|
@@ -522,9 +521,6 @@ public class Node implements Closeable {
|
|
|
SystemIndexMigrationExecutor.getNamedWriteables().stream()
|
|
|
).flatMap(Function.identity()).toList();
|
|
|
final NamedWriteableRegistry namedWriteableRegistry = new NamedWriteableRegistry(namedWriteables);
|
|
|
- Stream<NamedXContentRegistry.Entry> healthNodeTaskNamedXContentParsers = HealthNode.isEnabled()
|
|
|
- ? HealthNodeTaskExecutor.getNamedXContentParsers().stream()
|
|
|
- : Stream.empty();
|
|
|
NamedXContentRegistry xContentRegistry = new NamedXContentRegistry(
|
|
|
Stream.of(
|
|
|
NetworkModule.getNamedXContents().stream(),
|
|
@@ -533,7 +529,7 @@ public class Node implements Closeable {
|
|
|
pluginsService.flatMap(Plugin::getNamedXContent),
|
|
|
ClusterModule.getNamedXWriteables().stream(),
|
|
|
SystemIndexMigrationExecutor.getNamedXContentParsers().stream(),
|
|
|
- healthNodeTaskNamedXContentParsers
|
|
|
+ HealthNodeTaskExecutor.getNamedXContentParsers().stream()
|
|
|
).flatMap(Function.identity()).collect(toList())
|
|
|
);
|
|
|
final List<SystemIndices.Feature> features = pluginsService.filterPlugins(SystemIndexPlugin.class).stream().map(plugin -> {
|
|
@@ -915,12 +911,13 @@ public class Node implements Closeable {
|
|
|
metadataCreateIndexService,
|
|
|
settingsModule.getIndexScopedSettings()
|
|
|
);
|
|
|
- final HealthNodeTaskExecutor healthNodeTaskExecutor = HealthNode.isEnabled()
|
|
|
- ? HealthNodeTaskExecutor.create(clusterService, persistentTasksService, settings, clusterService.getClusterSettings())
|
|
|
- : null;
|
|
|
- final List<PersistentTasksExecutor<?>> builtinTaskExecutors = HealthNode.isEnabled()
|
|
|
- ? List.of(systemIndexMigrationExecutor, healthNodeTaskExecutor)
|
|
|
- : List.of(systemIndexMigrationExecutor);
|
|
|
+ final HealthNodeTaskExecutor healthNodeTaskExecutor = HealthNodeTaskExecutor.create(
|
|
|
+ clusterService,
|
|
|
+ persistentTasksService,
|
|
|
+ settings,
|
|
|
+ clusterService.getClusterSettings()
|
|
|
+ );
|
|
|
+ final List<PersistentTasksExecutor<?>> builtinTaskExecutors = List.of(systemIndexMigrationExecutor, healthNodeTaskExecutor);
|
|
|
final List<PersistentTasksExecutor<?>> pluginTaskExecutors = pluginsService.filterPlugins(PersistentTaskPlugin.class)
|
|
|
.stream()
|
|
|
.map(
|
|
@@ -962,13 +959,9 @@ public class Node implements Closeable {
|
|
|
masterHistoryService
|
|
|
);
|
|
|
HealthService healthService = createHealthService(clusterService, clusterModule, coordinationDiagnosticsService);
|
|
|
- HealthMetadataService healthMetadataService = HealthNode.isEnabled()
|
|
|
- ? HealthMetadataService.create(clusterService, settings)
|
|
|
- : null;
|
|
|
- LocalHealthMonitor localHealthMonitor = HealthNode.isEnabled()
|
|
|
- ? LocalHealthMonitor.create(settings, clusterService, nodeService, threadPool, client)
|
|
|
- : null;
|
|
|
- HealthInfoCache nodeHealthOverview = HealthNode.isEnabled() ? HealthInfoCache.create(clusterService) : null;
|
|
|
+ HealthMetadataService healthMetadataService = HealthMetadataService.create(clusterService, settings);
|
|
|
+ LocalHealthMonitor localHealthMonitor = LocalHealthMonitor.create(settings, clusterService, nodeService, threadPool, client);
|
|
|
+ HealthInfoCache nodeHealthOverview = HealthInfoCache.create(clusterService);
|
|
|
|
|
|
modules.add(b -> {
|
|
|
b.bind(Node.class).toInstance(this);
|
|
@@ -1053,12 +1046,10 @@ public class Node implements Closeable {
|
|
|
b.bind(HealthService.class).toInstance(healthService);
|
|
|
b.bind(MasterHistoryService.class).toInstance(masterHistoryService);
|
|
|
b.bind(CoordinationDiagnosticsService.class).toInstance(coordinationDiagnosticsService);
|
|
|
- if (HealthNode.isEnabled()) {
|
|
|
- b.bind(HealthNodeTaskExecutor.class).toInstance(healthNodeTaskExecutor);
|
|
|
- b.bind(HealthMetadataService.class).toInstance(healthMetadataService);
|
|
|
- b.bind(LocalHealthMonitor.class).toInstance(localHealthMonitor);
|
|
|
- b.bind(HealthInfoCache.class).toInstance(nodeHealthOverview);
|
|
|
- }
|
|
|
+ b.bind(HealthNodeTaskExecutor.class).toInstance(healthNodeTaskExecutor);
|
|
|
+ b.bind(HealthMetadataService.class).toInstance(healthMetadataService);
|
|
|
+ b.bind(LocalHealthMonitor.class).toInstance(localHealthMonitor);
|
|
|
+ b.bind(HealthInfoCache.class).toInstance(nodeHealthOverview);
|
|
|
b.bind(Tracer.class).toInstance(tracer);
|
|
|
b.bind(FileSettingsService.class).toInstance(fileSettingsService);
|
|
|
});
|
|
@@ -1171,9 +1162,7 @@ public class Node implements Closeable {
|
|
|
new ShardsAvailabilityHealthIndicatorService(clusterService, clusterModule.getAllocationService())
|
|
|
)
|
|
|
);
|
|
|
- if (HealthNode.isEnabled()) {
|
|
|
- serverHealthIndicatorServices.add(new DiskHealthIndicatorService(clusterService));
|
|
|
- }
|
|
|
+ serverHealthIndicatorServices.add(new DiskHealthIndicatorService(clusterService));
|
|
|
var pluginHealthIndicatorServices = pluginsService.filterPlugins(HealthPlugin.class)
|
|
|
.stream()
|
|
|
.flatMap(plugin -> plugin.getHealthIndicatorServices().stream())
|