Keep NodeConnectionsService in sync with current nodes in the cluster state
Companion commit to elastic/elasticsearchelastic/elasticsearch#22509
Original commit: elastic/x-pack-elasticsearch@d46a46bf681f27812746928b3250c0f3a6358713
@@ -9,9 +9,7 @@ import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.Version;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.PlainActionFuture;
-import org.elasticsearch.cluster.ClusterChangedEvent;
import org.elasticsearch.cluster.ClusterState;
-import org.elasticsearch.cluster.ClusterStateUpdateTask;
import org.elasticsearch.cluster.LocalClusterUpdateTask;
import org.elasticsearch.cluster.NodeConnectionsService;
import org.elasticsearch.cluster.block.ClusterBlocks;
@@ -44,7 +42,6 @@ import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
-import java.util.List;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
@@ -101,12 +98,12 @@ public class TransportMonitoringBulkActionTests extends ESTestCase {
Version.CURRENT));
clusterService.setNodeConnectionsService(new NodeConnectionsService(Settings.EMPTY, null, null) {
@Override
- public void connectToNodes(List<DiscoveryNode> addedNodes) {
+ public void connectToNodes(Iterable<DiscoveryNode> discoveryNodes) {
// skip
}
@Override
- public void disconnectFromNodes(List<DiscoveryNode> removedNodes) {
+ public void disconnectFromNodesExcept(Iterable<DiscoveryNode> nodesToKeep) {
// skip
}
});
