diff options
Diffstat (limited to 'test/framework/src/main')
-rw-r--r-- | test/framework/src/main/java/org/elasticsearch/cluster/MockInternalClusterInfoService.java | 6 | ||||
-rw-r--r-- | test/framework/src/main/java/org/elasticsearch/node/MockNode.java | 8 |
2 files changed, 9 insertions, 5 deletions
diff --git a/test/framework/src/main/java/org/elasticsearch/cluster/MockInternalClusterInfoService.java b/test/framework/src/main/java/org/elasticsearch/cluster/MockInternalClusterInfoService.java index fc45578357..4f6e8bb192 100644 --- a/test/framework/src/main/java/org/elasticsearch/cluster/MockInternalClusterInfoService.java +++ b/test/framework/src/main/java/org/elasticsearch/cluster/MockInternalClusterInfoService.java @@ -21,6 +21,7 @@ package org.elasticsearch.cluster; import java.util.Arrays; import java.util.Collections; import java.util.concurrent.CountDownLatch; +import java.util.function.Consumer; import org.elasticsearch.Version; import org.elasticsearch.action.ActionListener; @@ -69,8 +70,9 @@ public class MockInternalClusterInfoService extends InternalClusterInfoService { null, null, null); } - public MockInternalClusterInfoService(Settings settings, ClusterService clusterService, ThreadPool threadPool, NodeClient client) { - super(settings, clusterService, threadPool, client); + public MockInternalClusterInfoService(Settings settings, ClusterService clusterService, ThreadPool threadPool, NodeClient client, + Consumer<ClusterInfo> listener) { + super(settings, clusterService, threadPool, client, listener); this.clusterName = ClusterName.CLUSTER_NAME_SETTING.get(settings); stats[0] = makeStats("node_t1", new DiskUsage("node_t1", "n1", "/dev/null", 100, 100)); stats[1] = makeStats("node_t2", new DiskUsage("node_t2", "n2", "/dev/null", 100, 100)); diff --git a/test/framework/src/main/java/org/elasticsearch/node/MockNode.java b/test/framework/src/main/java/org/elasticsearch/node/MockNode.java index 6195838501..2e0aa98a92 100644 --- a/test/framework/src/main/java/org/elasticsearch/node/MockNode.java +++ b/test/framework/src/main/java/org/elasticsearch/node/MockNode.java @@ -20,6 +20,7 @@ package org.elasticsearch.node; import org.elasticsearch.client.node.NodeClient; +import org.elasticsearch.cluster.ClusterInfo; import org.elasticsearch.cluster.ClusterInfoService; import org.elasticsearch.cluster.MockInternalClusterInfoService; import org.elasticsearch.cluster.node.DiscoveryNode; @@ -47,6 +48,7 @@ import org.elasticsearch.transport.TransportService; import java.nio.file.Path; import java.util.Collection; import java.util.Collections; +import java.util.function.Consumer; import java.util.function.Function; /** @@ -124,11 +126,11 @@ public class MockNode extends Node { @Override protected ClusterInfoService newClusterInfoService(Settings settings, ClusterService clusterService, - ThreadPool threadPool, NodeClient client) { + ThreadPool threadPool, NodeClient client, Consumer<ClusterInfo> listener) { if (getPluginsService().filterPlugins(MockInternalClusterInfoService.TestPlugin.class).isEmpty()) { - return super.newClusterInfoService(settings, clusterService, threadPool, client); + return super.newClusterInfoService(settings, clusterService, threadPool, client, listener); } else { - return new MockInternalClusterInfoService(settings, clusterService, threadPool, client); + return new MockInternalClusterInfoService(settings, clusterService, threadPool, client, listener); } } } |