Search in sources :

Example 31 with DiscoveryNodes

use of org.elasticsearch.cluster.node.DiscoveryNodes in project elasticsearch by elastic.

the class UnicastZenPingTests method testPortLimit.

public void testPortLimit() throws InterruptedException {
    final NetworkService networkService = new NetworkService(Settings.EMPTY, Collections.emptyList());
    final Transport transport = new MockTcpTransport(Settings.EMPTY, threadPool, BigArrays.NON_RECYCLING_INSTANCE, new NoneCircuitBreakerService(), new NamedWriteableRegistry(Collections.emptyList()), networkService, Version.CURRENT) {

        @Override
        public BoundTransportAddress boundAddress() {
            return new BoundTransportAddress(new TransportAddress[] { new TransportAddress(InetAddress.getLoopbackAddress(), 9500) }, new TransportAddress(InetAddress.getLoopbackAddress(), 9500));
        }
    };
    closeables.push(transport);
    final TransportService transportService = new TransportService(Settings.EMPTY, transport, threadPool, TransportService.NOOP_TRANSPORT_INTERCEPTOR, x -> null, null);
    closeables.push(transportService);
    final int limitPortCounts = randomIntBetween(1, 10);
    final List<DiscoveryNode> discoveryNodes = TestUnicastZenPing.resolveHostsLists(executorService, logger, Collections.singletonList("127.0.0.1"), limitPortCounts, transportService, "test_", TimeValue.timeValueSeconds(1));
    assertThat(discoveryNodes, hasSize(limitPortCounts));
    final Set<Integer> ports = new HashSet<>();
    for (final DiscoveryNode discoveryNode : discoveryNodes) {
        assertTrue(discoveryNode.getAddress().address().getAddress().isLoopbackAddress());
        ports.add(discoveryNode.getAddress().getPort());
    }
    assertThat(ports, equalTo(IntStream.range(9300, 9300 + limitPortCounts).mapToObj(m -> m).collect(Collectors.toSet())));
}
Also used : NamedWriteableRegistry(org.elasticsearch.common.io.stream.NamedWriteableRegistry) Arrays(java.util.Arrays) BigArrays(org.elasticsearch.common.util.BigArrays) ConcurrentCollections(org.elasticsearch.common.util.concurrent.ConcurrentCollections) BiFunction(java.util.function.BiFunction) ClusterBlocks(org.elasticsearch.cluster.block.ClusterBlocks) InetAddress(java.net.InetAddress) STATE_NOT_RECOVERED_BLOCK(org.elasticsearch.gateway.GatewayService.STATE_NOT_RECOVERED_BLOCK) ClusterState(org.elasticsearch.cluster.ClusterState) ConnectTransportException(org.elasticsearch.transport.ConnectTransportException) Settings(org.elasticsearch.common.settings.Settings) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) Matchers.eq(org.mockito.Matchers.eq) After(org.junit.After) Map(java.util.Map) ThreadPool(org.elasticsearch.threadpool.ThreadPool) ClusterName(org.elasticsearch.cluster.ClusterName) Role(org.elasticsearch.cluster.node.DiscoveryNode.Role) ThreadFactory(java.util.concurrent.ThreadFactory) EnumSet(java.util.EnumSet) Transport(org.elasticsearch.transport.Transport) Collection(java.util.Collection) MockTcpTransport(org.elasticsearch.transport.MockTcpTransport) Set(java.util.Set) InetSocketAddress(java.net.InetSocketAddress) Collectors(java.util.stream.Collectors) CountDownLatch(java.util.concurrent.CountDownLatch) AbstractRunnable(org.elasticsearch.common.util.concurrent.AbstractRunnable) List(java.util.List) Logger(org.apache.logging.log4j.Logger) Version(org.elasticsearch.Version) TransportAddress(org.elasticsearch.common.transport.TransportAddress) TransportConnectionListener(org.elasticsearch.transport.TransportConnectionListener) TransportSettings(org.elasticsearch.transport.TransportSettings) Matchers.equalTo(org.hamcrest.Matchers.equalTo) TransportResponseHandler(org.elasticsearch.transport.TransportResponseHandler) TransportRequestOptions(org.elasticsearch.transport.TransportRequestOptions) TransportException(org.elasticsearch.transport.TransportException) NetworkAddress(org.elasticsearch.common.network.NetworkAddress) Mockito.mock(org.mockito.Mockito.mock) IntStream(java.util.stream.IntStream) Matchers(org.mockito.Matchers) HashMap(java.util.HashMap) BoundTransportAddress(org.elasticsearch.common.transport.BoundTransportAddress) AtomicReference(java.util.concurrent.atomic.AtomicReference) CheckedBiConsumer(org.elasticsearch.common.CheckedBiConsumer) Stack(java.util.Stack) ArrayList(java.util.ArrayList) ConcurrentMap(java.util.concurrent.ConcurrentMap) HashSet(java.util.HashSet) DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) NetworkService(org.elasticsearch.common.network.NetworkService) NoneCircuitBreakerService(org.elasticsearch.indices.breaker.NoneCircuitBreakerService) NamedWriteableRegistry(org.elasticsearch.common.io.stream.NamedWriteableRegistry) TimeValue(org.elasticsearch.common.unit.TimeValue) Matchers.hasSize(org.hamcrest.Matchers.hasSize) ESTestCase(org.elasticsearch.test.ESTestCase) MockTransportService(org.elasticsearch.test.transport.MockTransportService) TransportService(org.elasticsearch.transport.TransportService) ExecutorService(java.util.concurrent.ExecutorService) Before(org.junit.Before) ConnectionProfile(org.elasticsearch.transport.ConnectionProfile) Collections.emptyMap(java.util.Collections.emptyMap) DiscoveryNodes(org.elasticsearch.cluster.node.DiscoveryNodes) TestThreadPool(org.elasticsearch.threadpool.TestThreadPool) Matchers.empty(org.hamcrest.Matchers.empty) EsExecutors(org.elasticsearch.common.util.concurrent.EsExecutors) Collections.emptySet(java.util.Collections.emptySet) IOUtils(org.apache.lucene.util.IOUtils) IOException(java.io.IOException) UnknownHostException(java.net.UnknownHostException) VersionUtils(org.elasticsearch.test.VersionUtils) Mockito.verify(org.mockito.Mockito.verify) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) Closeable(java.io.Closeable) Collections(java.util.Collections) DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) TransportAddress(org.elasticsearch.common.transport.TransportAddress) BoundTransportAddress(org.elasticsearch.common.transport.BoundTransportAddress) MockTcpTransport(org.elasticsearch.transport.MockTcpTransport) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) MockTransportService(org.elasticsearch.test.transport.MockTransportService) TransportService(org.elasticsearch.transport.TransportService) BoundTransportAddress(org.elasticsearch.common.transport.BoundTransportAddress) NetworkService(org.elasticsearch.common.network.NetworkService) Transport(org.elasticsearch.transport.Transport) MockTcpTransport(org.elasticsearch.transport.MockTcpTransport) NoneCircuitBreakerService(org.elasticsearch.indices.breaker.NoneCircuitBreakerService) HashSet(java.util.HashSet)

Example 32 with DiscoveryNodes

use of org.elasticsearch.cluster.node.DiscoveryNodes in project elasticsearch by elastic.

the class PublishClusterStateActionTests method testUnexpectedDiffPublishing.

public void testUnexpectedDiffPublishing() throws Exception {
    MockNode nodeA = createMockNode("nodeA", Settings.EMPTY, event -> {
        fail("Shouldn't send cluster state to myself");
    }).setAsMaster();
    MockNode nodeB = createMockNode("nodeB");
    // Initial cluster state with both states - the second node still shouldn't
    // get diff even though it's present in the previous cluster state
    DiscoveryNodes discoveryNodes = DiscoveryNodes.builder(nodeA.nodes()).add(nodeB.discoveryNode).build();
    ClusterState previousClusterState = ClusterState.builder(CLUSTER_NAME).nodes(discoveryNodes).build();
    ClusterState clusterState = ClusterState.builder(previousClusterState).incrementVersion().build();
    publishStateAndWait(nodeA.action, clusterState, previousClusterState);
    assertSameStateFromFull(nodeB.clusterState, clusterState);
    // cluster state update - add block
    previousClusterState = clusterState;
    clusterState = ClusterState.builder(clusterState).blocks(ClusterBlocks.builder().addGlobalBlock(MetaData.CLUSTER_READ_ONLY_BLOCK)).incrementVersion().build();
    publishStateAndWait(nodeA.action, clusterState, previousClusterState);
    assertSameStateFromDiff(nodeB.clusterState, clusterState);
}
Also used : ElasticsearchException(org.elasticsearch.ElasticsearchException) MetaData(org.elasticsearch.cluster.metadata.MetaData) Matchers.hasToString(org.hamcrest.Matchers.hasToString) StreamOutput(org.elasticsearch.common.io.stream.StreamOutput) Arrays(java.util.Arrays) Nullable(org.elasticsearch.common.Nullable) Matchers.not(org.hamcrest.Matchers.not) ClusterBlocks(org.elasticsearch.cluster.block.ClusterBlocks) ClusterStateListener(org.elasticsearch.cluster.ClusterStateListener) Diff(org.elasticsearch.cluster.Diff) CoreMatchers.instanceOf(org.hamcrest.CoreMatchers.instanceOf) ClusterState(org.elasticsearch.cluster.ClusterState) Settings(org.elasticsearch.common.settings.Settings) Locale(java.util.Locale) After(org.junit.After) Map(java.util.Map) Matchers.nullValue(org.hamcrest.Matchers.nullValue) ThreadPool(org.elasticsearch.threadpool.ThreadPool) ClusterName(org.elasticsearch.cluster.ClusterName) BytesTransportRequest(org.elasticsearch.transport.BytesTransportRequest) TransportResponseOptions(org.elasticsearch.transport.TransportResponseOptions) Matchers.notNullValue(org.hamcrest.Matchers.notNullValue) TestLogging(org.elasticsearch.test.junit.annotations.TestLogging) ClusterModule(org.elasticsearch.cluster.ClusterModule) ClusterChangedEvent(org.elasticsearch.cluster.ClusterChangedEvent) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) Logger(org.apache.logging.log4j.Logger) Version(org.elasticsearch.Version) TransportConnectionListener(org.elasticsearch.transport.TransportConnectionListener) IndexMetaData(org.elasticsearch.cluster.metadata.IndexMetaData) Matchers.equalTo(org.hamcrest.Matchers.equalTo) Matchers.containsString(org.hamcrest.Matchers.containsString) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) ImmutableOpenMap(org.elasticsearch.common.collect.ImmutableOpenMap) TransportChannel(org.elasticsearch.transport.TransportChannel) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) AtomicReference(java.util.concurrent.atomic.AtomicReference) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) NamedWriteableRegistry(org.elasticsearch.common.io.stream.NamedWriteableRegistry) Node(org.elasticsearch.node.Node) TransportResponse(org.elasticsearch.transport.TransportResponse) ESTestCase(org.elasticsearch.test.ESTestCase) MockTransportService(org.elasticsearch.test.transport.MockTransportService) TransportService(org.elasticsearch.transport.TransportService) Before(org.junit.Before) DiscoveryNodes(org.elasticsearch.cluster.node.DiscoveryNodes) TestThreadPool(org.elasticsearch.threadpool.TestThreadPool) Discovery(org.elasticsearch.discovery.Discovery) DiscoverySettings(org.elasticsearch.discovery.DiscoverySettings) IOException(java.io.IOException) TimeUnit(java.util.concurrent.TimeUnit) ClusterSettings(org.elasticsearch.common.settings.ClusterSettings) Matchers.emptyIterable(org.hamcrest.Matchers.emptyIterable) Tuple(org.elasticsearch.common.collect.Tuple) Collections(java.util.Collections) Randomness(org.elasticsearch.common.Randomness) ClusterState(org.elasticsearch.cluster.ClusterState) DiscoveryNodes(org.elasticsearch.cluster.node.DiscoveryNodes)

Example 33 with DiscoveryNodes

use of org.elasticsearch.cluster.node.DiscoveryNodes in project elasticsearch by elastic.

the class PublishClusterStateActionTests method testSimpleClusterStatePublishing.

public void testSimpleClusterStatePublishing() throws Exception {
    MockNode nodeA = createMockNode("nodeA").setAsMaster();
    MockNode nodeB = createMockNode("nodeB");
    // Initial cluster state
    ClusterState clusterState = nodeA.clusterState;
    // cluster state update - add nodeB
    DiscoveryNodes discoveryNodes = DiscoveryNodes.builder(clusterState.nodes()).add(nodeB.discoveryNode).build();
    ClusterState previousClusterState = clusterState;
    clusterState = ClusterState.builder(clusterState).nodes(discoveryNodes).incrementVersion().build();
    publishStateAndWait(nodeA.action, clusterState, previousClusterState);
    assertSameStateFromFull(nodeB.clusterState, clusterState);
    // cluster state update - add block
    previousClusterState = clusterState;
    clusterState = ClusterState.builder(clusterState).blocks(ClusterBlocks.builder().addGlobalBlock(MetaData.CLUSTER_READ_ONLY_BLOCK)).incrementVersion().build();
    publishStateAndWait(nodeA.action, clusterState, previousClusterState);
    assertSameStateFromDiff(nodeB.clusterState, clusterState);
    assertThat(nodeB.clusterState.blocks().global().size(), equalTo(1));
    // cluster state update - remove block
    previousClusterState = clusterState;
    clusterState = ClusterState.builder(clusterState).blocks(ClusterBlocks.EMPTY_CLUSTER_BLOCK).incrementVersion().build();
    publishStateAndWait(nodeA.action, clusterState, previousClusterState);
    assertSameStateFromDiff(nodeB.clusterState, clusterState);
    assertTrue(nodeB.clusterState.wasReadFromDiff());
    // Adding new node - this node should get full cluster state while nodeB should still be getting diffs
    MockNode nodeC = createMockNode("nodeC");
    // cluster state update 3 - register node C
    previousClusterState = clusterState;
    discoveryNodes = DiscoveryNodes.builder(discoveryNodes).add(nodeC.discoveryNode).build();
    clusterState = ClusterState.builder(clusterState).nodes(discoveryNodes).incrementVersion().build();
    publishStateAndWait(nodeA.action, clusterState, previousClusterState);
    assertSameStateFromDiff(nodeB.clusterState, clusterState);
    // First state
    assertSameStateFromFull(nodeC.clusterState, clusterState);
    // cluster state update 4 - update settings
    previousClusterState = clusterState;
    MetaData metaData = MetaData.builder(clusterState.metaData()).transientSettings(Settings.builder().put("foo", "bar").build()).build();
    clusterState = ClusterState.builder(clusterState).metaData(metaData).incrementVersion().build();
    publishStateAndWait(nodeA.action, clusterState, previousClusterState);
    assertSameStateFromDiff(nodeB.clusterState, clusterState);
    assertThat(nodeB.clusterState.blocks().global().size(), equalTo(0));
    assertSameStateFromDiff(nodeC.clusterState, clusterState);
    assertThat(nodeC.clusterState.blocks().global().size(), equalTo(0));
    // cluster state update - skipping one version change - should request full cluster state
    previousClusterState = ClusterState.builder(clusterState).incrementVersion().build();
    clusterState = ClusterState.builder(clusterState).incrementVersion().build();
    publishStateAndWait(nodeA.action, clusterState, previousClusterState);
    assertSameStateFromFull(nodeB.clusterState, clusterState);
    assertSameStateFromFull(nodeC.clusterState, clusterState);
    assertFalse(nodeC.clusterState.wasReadFromDiff());
    // node A steps down from being master
    nodeA.resetMasterId();
    nodeB.resetMasterId();
    nodeC.resetMasterId();
    // node B becomes the master and sends a version of the cluster state that goes back
    discoveryNodes = DiscoveryNodes.builder(discoveryNodes).add(nodeA.discoveryNode).add(nodeB.discoveryNode).add(nodeC.discoveryNode).masterNodeId(nodeB.discoveryNode.getId()).localNodeId(nodeB.discoveryNode.getId()).build();
    previousClusterState = ClusterState.builder(new ClusterName("test")).nodes(discoveryNodes).build();
    clusterState = ClusterState.builder(clusterState).nodes(discoveryNodes).incrementVersion().build();
    publishStateAndWait(nodeB.action, clusterState, previousClusterState);
    assertSameStateFromFull(nodeA.clusterState, clusterState);
    assertSameStateFromFull(nodeC.clusterState, clusterState);
}
Also used : ClusterState(org.elasticsearch.cluster.ClusterState) MetaData(org.elasticsearch.cluster.metadata.MetaData) IndexMetaData(org.elasticsearch.cluster.metadata.IndexMetaData) ClusterName(org.elasticsearch.cluster.ClusterName) DiscoveryNodes(org.elasticsearch.cluster.node.DiscoveryNodes)

Example 34 with DiscoveryNodes

use of org.elasticsearch.cluster.node.DiscoveryNodes in project elasticsearch by elastic.

the class AsyncShardFetchTests method testFullCircleSingleNodeSuccess.

public void testFullCircleSingleNodeSuccess() throws Exception {
    DiscoveryNodes nodes = DiscoveryNodes.builder().add(node1).build();
    test.addSimulation(node1.getId(), response1);
    // first fetch, no data, still on going
    AsyncShardFetch.FetchResult<Response> fetchData = test.fetchData(nodes, emptySet());
    assertThat(fetchData.hasData(), equalTo(false));
    assertThat(test.reroute.get(), equalTo(0));
    // fire a response, wait on reroute incrementing
    test.fireSimulationAndWait(node1.getId());
    // verify we get back the data node
    assertThat(test.reroute.get(), equalTo(1));
    fetchData = test.fetchData(nodes, emptySet());
    assertThat(fetchData.hasData(), equalTo(true));
    assertThat(fetchData.getData().size(), equalTo(1));
    assertThat(fetchData.getData().get(node1), sameInstance(response1));
}
Also used : BaseNodeResponse(org.elasticsearch.action.support.nodes.BaseNodeResponse) DiscoveryNodes(org.elasticsearch.cluster.node.DiscoveryNodes)

Example 35 with DiscoveryNodes

use of org.elasticsearch.cluster.node.DiscoveryNodes in project elasticsearch by elastic.

the class TransportSearchAction method executeSearch.

private void executeSearch(SearchTask task, long startTimeInMillis, SearchRequest searchRequest, String[] localIndices, List<ShardIterator> remoteShardIterators, Function<String, Transport.Connection> remoteConnections, ClusterState clusterState, Map<String, AliasFilter> remoteAliasMap, ActionListener<SearchResponse> listener) {
    clusterState.blocks().globalBlockedRaiseException(ClusterBlockLevel.READ);
    // TODO: I think startTime() should become part of ActionRequest and that should be used both for index name
    // date math expressions and $now in scripts. This way all apis will deal with now in the same way instead
    // of just for the _search api
    final Index[] indices;
    if (localIndices.length == 0 && remoteShardIterators.size() > 0) {
        // don't search on _all if only remote indices were specified
        indices = Index.EMPTY_ARRAY;
    } else {
        indices = indexNameExpressionResolver.concreteIndices(clusterState, searchRequest.indicesOptions(), startTimeInMillis, localIndices);
    }
    Map<String, AliasFilter> aliasFilter = buildPerIndexAliasFilter(searchRequest, clusterState, indices, remoteAliasMap);
    Map<String, Set<String>> routingMap = indexNameExpressionResolver.resolveSearchRouting(clusterState, searchRequest.routing(), searchRequest.indices());
    String[] concreteIndices = new String[indices.length];
    for (int i = 0; i < indices.length; i++) {
        concreteIndices[i] = indices[i].getName();
    }
    GroupShardsIterator localShardsIterator = clusterService.operationRouting().searchShards(clusterState, concreteIndices, routingMap, searchRequest.preference());
    GroupShardsIterator shardIterators = mergeShardsIterators(localShardsIterator, remoteShardIterators);
    failIfOverShardCountLimit(clusterService, shardIterators.size());
    Map<String, Float> concreteIndexBoosts = resolveIndexBoosts(searchRequest, clusterState);
    // optimize search type for cases where there is only one shard group to search on
    if (shardIterators.size() == 1) {
        // if we only have one group, then we always want Q_A_F, no need for DFS, and no need to do THEN since we hit one shard
        searchRequest.searchType(QUERY_THEN_FETCH);
    }
    if (searchRequest.isSuggestOnly()) {
        // disable request cache if we have only suggest
        searchRequest.requestCache(false);
        switch(searchRequest.searchType()) {
            case DFS_QUERY_THEN_FETCH:
                // convert to Q_T_F if we have only suggest
                searchRequest.searchType(QUERY_THEN_FETCH);
                break;
        }
    }
    final DiscoveryNodes nodes = clusterState.nodes();
    Function<String, Transport.Connection> connectionLookup = (nodeId) -> {
        final DiscoveryNode discoveryNode = nodes.get(nodeId);
        final Transport.Connection connection;
        if (discoveryNode != null) {
            connection = searchTransportService.getConnection(discoveryNode);
        } else {
            connection = remoteConnections.apply(nodeId);
        }
        if (connection == null) {
            throw new IllegalStateException("no node found for id: " + nodeId);
        }
        return connection;
    };
    searchAsyncAction(task, searchRequest, shardIterators, startTimeInMillis, connectionLookup, clusterState.version(), Collections.unmodifiableMap(aliasFilter), concreteIndexBoosts, listener).start();
}
Also used : ShardIterator(org.elasticsearch.cluster.routing.ShardIterator) Property(org.elasticsearch.common.settings.Setting.Property) ClusterService(org.elasticsearch.cluster.service.ClusterService) HashMap(java.util.HashMap) Index(org.elasticsearch.index.Index) Function(java.util.function.Function) SearchService(org.elasticsearch.search.SearchService) GroupShardsIterator(org.elasticsearch.cluster.routing.GroupShardsIterator) Strings(org.elasticsearch.common.Strings) Inject(org.elasticsearch.common.inject.Inject) ArrayList(java.util.ArrayList) ClusterState(org.elasticsearch.cluster.ClusterState) DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) Settings(org.elasticsearch.common.settings.Settings) HandledTransportAction(org.elasticsearch.action.support.HandledTransportAction) Map(java.util.Map) SearchSourceBuilder(org.elasticsearch.search.builder.SearchSourceBuilder) ThreadPool(org.elasticsearch.threadpool.ThreadPool) TransportService(org.elasticsearch.transport.TransportService) ClusterBlockLevel(org.elasticsearch.cluster.block.ClusterBlockLevel) DiscoveryNodes(org.elasticsearch.cluster.node.DiscoveryNodes) ActionFilters(org.elasticsearch.action.support.ActionFilters) Transport(org.elasticsearch.transport.Transport) Setting(org.elasticsearch.common.settings.Setting) Executor(java.util.concurrent.Executor) Set(java.util.Set) QUERY_THEN_FETCH(org.elasticsearch.action.search.SearchType.QUERY_THEN_FETCH) AliasFilter(org.elasticsearch.search.internal.AliasFilter) List(java.util.List) IndexNameExpressionResolver(org.elasticsearch.cluster.metadata.IndexNameExpressionResolver) Task(org.elasticsearch.tasks.Task) Collections(java.util.Collections) ActionListener(org.elasticsearch.action.ActionListener) AliasFilter(org.elasticsearch.search.internal.AliasFilter) DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) Set(java.util.Set) Index(org.elasticsearch.index.Index) GroupShardsIterator(org.elasticsearch.cluster.routing.GroupShardsIterator) DiscoveryNodes(org.elasticsearch.cluster.node.DiscoveryNodes)

Aggregations

DiscoveryNodes (org.elasticsearch.cluster.node.DiscoveryNodes)129 DiscoveryNode (org.elasticsearch.cluster.node.DiscoveryNode)74 ClusterState (org.elasticsearch.cluster.ClusterState)45 Settings (org.elasticsearch.common.settings.Settings)37 ArrayList (java.util.ArrayList)32 IOException (java.io.IOException)27 HashSet (java.util.HashSet)25 List (java.util.List)24 Map (java.util.Map)23 TransportService (org.elasticsearch.transport.TransportService)23 Version (org.elasticsearch.Version)22 HashMap (java.util.HashMap)20 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)20 ShardRouting (org.elasticsearch.cluster.routing.ShardRouting)20 Set (java.util.Set)19 TransportException (org.elasticsearch.transport.TransportException)19 Collections (java.util.Collections)18 ThreadPool (org.elasticsearch.threadpool.ThreadPool)18 CountDownLatch (java.util.concurrent.CountDownLatch)16 Collectors (java.util.stream.Collectors)16