|
@@ -26,8 +26,8 @@ import org.apache.lucene.util.SetOnce;
|
|
|
import org.elasticsearch.Build;
|
|
import org.elasticsearch.Build;
|
|
|
import org.elasticsearch.ElasticsearchException;
|
|
import org.elasticsearch.ElasticsearchException;
|
|
|
import org.elasticsearch.ElasticsearchTimeoutException;
|
|
import org.elasticsearch.ElasticsearchTimeoutException;
|
|
|
-import org.elasticsearch.action.ActionType;
|
|
|
|
|
import org.elasticsearch.action.ActionModule;
|
|
import org.elasticsearch.action.ActionModule;
|
|
|
|
|
+import org.elasticsearch.action.ActionType;
|
|
|
import org.elasticsearch.action.admin.cluster.snapshots.status.TransportNodesSnapshotsStatus;
|
|
import org.elasticsearch.action.admin.cluster.snapshots.status.TransportNodesSnapshotsStatus;
|
|
|
import org.elasticsearch.action.search.SearchExecutionStatsCollector;
|
|
import org.elasticsearch.action.search.SearchExecutionStatsCollector;
|
|
|
import org.elasticsearch.action.search.SearchPhaseController;
|
|
import org.elasticsearch.action.search.SearchPhaseController;
|
|
@@ -38,7 +38,6 @@ import org.elasticsearch.bootstrap.BootstrapCheck;
|
|
|
import org.elasticsearch.bootstrap.BootstrapContext;
|
|
import org.elasticsearch.bootstrap.BootstrapContext;
|
|
|
import org.elasticsearch.client.Client;
|
|
import org.elasticsearch.client.Client;
|
|
|
import org.elasticsearch.client.node.NodeClient;
|
|
import org.elasticsearch.client.node.NodeClient;
|
|
|
-import org.elasticsearch.cluster.ClusterInfo;
|
|
|
|
|
import org.elasticsearch.cluster.ClusterInfoService;
|
|
import org.elasticsearch.cluster.ClusterInfoService;
|
|
|
import org.elasticsearch.cluster.ClusterModule;
|
|
import org.elasticsearch.cluster.ClusterModule;
|
|
|
import org.elasticsearch.cluster.ClusterName;
|
|
import org.elasticsearch.cluster.ClusterName;
|
|
@@ -57,7 +56,6 @@ import org.elasticsearch.cluster.metadata.TemplateUpgradeService;
|
|
|
import org.elasticsearch.cluster.node.DiscoveryNode;
|
|
import org.elasticsearch.cluster.node.DiscoveryNode;
|
|
|
import org.elasticsearch.cluster.node.DiscoveryNodeRole;
|
|
import org.elasticsearch.cluster.node.DiscoveryNodeRole;
|
|
|
import org.elasticsearch.cluster.routing.BatchedRerouteService;
|
|
import org.elasticsearch.cluster.routing.BatchedRerouteService;
|
|
|
-import org.elasticsearch.cluster.routing.LazilyInitializedRerouteService;
|
|
|
|
|
import org.elasticsearch.cluster.routing.RerouteService;
|
|
import org.elasticsearch.cluster.routing.RerouteService;
|
|
|
import org.elasticsearch.cluster.routing.allocation.DiskThresholdMonitor;
|
|
import org.elasticsearch.cluster.routing.allocation.DiskThresholdMonitor;
|
|
|
import org.elasticsearch.cluster.service.ClusterService;
|
|
import org.elasticsearch.cluster.service.ClusterService;
|
|
@@ -177,7 +175,6 @@ import java.util.Optional;
|
|
|
import java.util.Set;
|
|
import java.util.Set;
|
|
|
import java.util.concurrent.CountDownLatch;
|
|
import java.util.concurrent.CountDownLatch;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.TimeUnit;
|
|
|
-import java.util.function.Consumer;
|
|
|
|
|
import java.util.function.Function;
|
|
import java.util.function.Function;
|
|
|
import java.util.function.UnaryOperator;
|
|
import java.util.function.UnaryOperator;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
@@ -371,11 +368,7 @@ public class Node implements Closeable {
|
|
|
.newHashPublisher());
|
|
.newHashPublisher());
|
|
|
final IngestService ingestService = new IngestService(clusterService, threadPool, this.environment,
|
|
final IngestService ingestService = new IngestService(clusterService, threadPool, this.environment,
|
|
|
scriptModule.getScriptService(), analysisModule.getAnalysisRegistry(), pluginsService.filterPlugins(IngestPlugin.class));
|
|
scriptModule.getScriptService(), analysisModule.getAnalysisRegistry(), pluginsService.filterPlugins(IngestPlugin.class));
|
|
|
- final LazilyInitializedRerouteService lazilyInitializedRerouteService = new LazilyInitializedRerouteService();
|
|
|
|
|
- final DiskThresholdMonitor diskThresholdMonitor = new DiskThresholdMonitor(settings, clusterService::state,
|
|
|
|
|
- clusterService.getClusterSettings(), client, threadPool::relativeTimeInMillis, lazilyInitializedRerouteService);
|
|
|
|
|
- final ClusterInfoService clusterInfoService = newClusterInfoService(settings, clusterService, threadPool, client,
|
|
|
|
|
- diskThresholdMonitor::onNewInfo);
|
|
|
|
|
|
|
+ final ClusterInfoService clusterInfoService = newClusterInfoService(settings, clusterService, threadPool, client);
|
|
|
final UsageService usageService = new UsageService();
|
|
final UsageService usageService = new UsageService();
|
|
|
|
|
|
|
|
ModulesBuilder modules = new ModulesBuilder();
|
|
ModulesBuilder modules = new ModulesBuilder();
|
|
@@ -508,7 +501,10 @@ public class Node implements Closeable {
|
|
|
|
|
|
|
|
final RerouteService rerouteService
|
|
final RerouteService rerouteService
|
|
|
= new BatchedRerouteService(clusterService, clusterModule.getAllocationService()::reroute);
|
|
= new BatchedRerouteService(clusterService, clusterModule.getAllocationService()::reroute);
|
|
|
- lazilyInitializedRerouteService.setRerouteService(rerouteService);
|
|
|
|
|
|
|
+ final DiskThresholdMonitor diskThresholdMonitor = new DiskThresholdMonitor(settings, clusterService::state,
|
|
|
|
|
+ clusterService.getClusterSettings(), client, threadPool::relativeTimeInMillis, rerouteService);
|
|
|
|
|
+ clusterInfoService.addListener(diskThresholdMonitor::onNewInfo);
|
|
|
|
|
+
|
|
|
final DiscoveryModule discoveryModule = new DiscoveryModule(settings, threadPool, transportService, namedWriteableRegistry,
|
|
final DiscoveryModule discoveryModule = new DiscoveryModule(settings, threadPool, transportService, namedWriteableRegistry,
|
|
|
networkService, clusterService.getMasterService(), clusterService.getClusterApplierService(),
|
|
networkService, clusterService.getMasterService(), clusterService.getClusterApplierService(),
|
|
|
clusterService.getClusterSettings(), pluginsService.filterPlugins(DiscoveryPlugin.class),
|
|
clusterService.getClusterSettings(), pluginsService.filterPlugins(DiscoveryPlugin.class),
|
|
@@ -1017,8 +1013,8 @@ public class Node implements Closeable {
|
|
|
|
|
|
|
|
/** Constructs a ClusterInfoService which may be mocked for tests. */
|
|
/** Constructs a ClusterInfoService which may be mocked for tests. */
|
|
|
protected ClusterInfoService newClusterInfoService(Settings settings, ClusterService clusterService,
|
|
protected ClusterInfoService newClusterInfoService(Settings settings, ClusterService clusterService,
|
|
|
- ThreadPool threadPool, NodeClient client, Consumer<ClusterInfo> listeners) {
|
|
|
|
|
- return new InternalClusterInfoService(settings, clusterService, threadPool, client, listeners);
|
|
|
|
|
|
|
+ ThreadPool threadPool, NodeClient client) {
|
|
|
|
|
+ return new InternalClusterInfoService(settings, clusterService, threadPool, client);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/** Constructs a {@link org.elasticsearch.http.HttpServerTransport} which may be mocked for tests. */
|
|
/** Constructs a {@link org.elasticsearch.http.HttpServerTransport} which may be mocked for tests. */
|