Search in sources :

Example 76 with DiscoveryNodes

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

the class TransportTasksActionTests method serialize.

private Map<String, Object> serialize(ListTasksResponse response, boolean byParents) throws IOException {
    XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON);
    builder.startObject();
    if (byParents) {
        DiscoveryNodes nodes = testNodes[0].clusterService.state().nodes();
        response.toXContentGroupedByNode(builder, ToXContent.EMPTY_PARAMS, nodes);
    } else {
        response.toXContentGroupedByParents(builder, ToXContent.EMPTY_PARAMS);
    }
    builder.endObject();
    builder.flush();
    logger.info(builder.string());
    return XContentHelper.convertToMap(builder.bytes(), false, builder.contentType()).v2();
}
Also used : XContentBuilder(org.elasticsearch.common.xcontent.XContentBuilder) DiscoveryNodes(org.elasticsearch.cluster.node.DiscoveryNodes)

Example 77 with DiscoveryNodes

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

the class TransportNodesActionTests method setUp.

@Before
public void setUp() throws Exception {
    super.setUp();
    transport = new CapturingTransport();
    clusterService = createClusterService(THREAD_POOL);
    transportService = new TransportService(clusterService.getSettings(), transport, THREAD_POOL, TransportService.NOOP_TRANSPORT_INTERCEPTOR, x -> clusterService.localNode(), null);
    transportService.start();
    transportService.acceptIncomingRequests();
    int numNodes = randomIntBetween(3, 10);
    DiscoveryNodes.Builder discoBuilder = DiscoveryNodes.builder();
    List<DiscoveryNode> discoveryNodes = new ArrayList<>();
    for (int i = 0; i < numNodes; i++) {
        Map<String, String> attributes = new HashMap<>();
        Set<DiscoveryNode.Role> roles = new HashSet<>(randomSubsetOf(Arrays.asList(DiscoveryNode.Role.values())));
        if (frequently()) {
            attributes.put("custom", randomBoolean() ? "match" : randomAsciiOfLengthBetween(3, 5));
        }
        final DiscoveryNode node = newNode(i, attributes, roles);
        discoBuilder = discoBuilder.add(node);
        discoveryNodes.add(node);
    }
    discoBuilder.localNodeId(randomFrom(discoveryNodes).getId());
    discoBuilder.masterNodeId(randomFrom(discoveryNodes).getId());
    ClusterState.Builder stateBuilder = ClusterState.builder(clusterService.getClusterName());
    stateBuilder.nodes(discoBuilder);
    ClusterState clusterState = stateBuilder.build();
    setState(clusterService, clusterState);
}
Also used : StreamOutput(org.elasticsearch.common.io.stream.StreamOutput) Arrays(java.util.Arrays) FailedNodeException(org.elasticsearch.action.FailedNodeException) BeforeClass(org.junit.BeforeClass) ClusterServiceUtils.createClusterService(org.elasticsearch.test.ClusterServiceUtils.createClusterService) ClusterService(org.elasticsearch.cluster.service.ClusterService) HashMap(java.util.HashMap) Supplier(java.util.function.Supplier) CapturingTransport(org.elasticsearch.test.transport.CapturingTransport) ArrayList(java.util.ArrayList) AtomicReferenceArray(java.util.concurrent.atomic.AtomicReferenceArray) HashSet(java.util.HashSet) ClusterState(org.elasticsearch.cluster.ClusterState) DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) Settings(org.elasticsearch.common.settings.Settings) After(org.junit.After) Map(java.util.Map) ThreadPool(org.elasticsearch.threadpool.ThreadPool) ClusterName(org.elasticsearch.cluster.ClusterName) ESTestCase(org.elasticsearch.test.ESTestCase) TransportService(org.elasticsearch.transport.TransportService) Before(org.junit.Before) DiscoveryNodes(org.elasticsearch.cluster.node.DiscoveryNodes) TestThreadPool(org.elasticsearch.threadpool.TestThreadPool) AfterClass(org.junit.AfterClass) ActionFilters(org.elasticsearch.action.support.ActionFilters) PlainActionFuture(org.elasticsearch.action.support.PlainActionFuture) Set(java.util.Set) IOException(java.io.IOException) TimeUnit(java.util.concurrent.TimeUnit) List(java.util.List) Version(org.elasticsearch.Version) StreamInput(org.elasticsearch.common.io.stream.StreamInput) Collections(java.util.Collections) ClusterServiceUtils.setState(org.elasticsearch.test.ClusterServiceUtils.setState) TransportBroadcastByNodeActionTests(org.elasticsearch.action.support.broadcast.node.TransportBroadcastByNodeActionTests) Mockito.mock(org.mockito.Mockito.mock) ClusterState(org.elasticsearch.cluster.ClusterState) DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) HashMap(java.util.HashMap) CapturingTransport(org.elasticsearch.test.transport.CapturingTransport) ArrayList(java.util.ArrayList) TransportService(org.elasticsearch.transport.TransportService) DiscoveryNodes(org.elasticsearch.cluster.node.DiscoveryNodes) HashSet(java.util.HashSet) Before(org.junit.Before)

Example 78 with DiscoveryNodes

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

the class PublishClusterStateActionTests method testSerializationFailureDuringDiffPublishing.

public void testSerializationFailureDuringDiffPublishing() throws Exception {
    MockNode nodeA = createMockNode("nodeA", Settings.EMPTY, new ClusterStateListener() {

        @Override
        public void clusterChanged(ClusterChangedEvent 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();
    ClusterState unserializableClusterState = new ClusterState(clusterState.version(), clusterState.stateUUID(), clusterState) {

        @Override
        public Diff<ClusterState> diff(ClusterState previousState) {
            return new Diff<ClusterState>() {

                @Override
                public ClusterState apply(ClusterState part) {
                    fail("this diff shouldn't be applied");
                    return part;
                }

                @Override
                public void writeTo(StreamOutput out) throws IOException {
                    throw new IOException("Simulated failure of diff serialization");
                }
            };
        }
    };
    try {
        publishStateAndWait(nodeA.action, unserializableClusterState, previousClusterState);
        fail("cluster state published despite of diff errors");
    } catch (Discovery.FailedToCommitClusterStateException e) {
        assertThat(e.getCause(), notNullValue());
        assertThat(e.getCause().getMessage(), containsString("failed to serialize"));
    }
}
Also used : ClusterState(org.elasticsearch.cluster.ClusterState) Diff(org.elasticsearch.cluster.Diff) Discovery(org.elasticsearch.discovery.Discovery) ClusterChangedEvent(org.elasticsearch.cluster.ClusterChangedEvent) IOException(java.io.IOException) StreamOutput(org.elasticsearch.common.io.stream.StreamOutput) DiscoveryNodes(org.elasticsearch.cluster.node.DiscoveryNodes) ClusterStateListener(org.elasticsearch.cluster.ClusterStateListener)

Example 79 with DiscoveryNodes

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

the class PublishClusterStateActionTests method testPublishingWithSendingErrors.

public void testPublishingWithSendingErrors() throws Exception {
    int goodNodes = randomIntBetween(2, 5);
    int errorNodes = randomIntBetween(1, 5);
    // adding timeout nodes will force timeout errors
    int timeOutNodes = randomBoolean() ? 0 : randomIntBetween(1, 5);
    // master
    final int numberOfMasterNodes = goodNodes + errorNodes + timeOutNodes + 1;
    final boolean expectingToCommit = randomBoolean();
    Settings.Builder settings = Settings.builder();
    // make sure we have a reasonable timeout if we expect to timeout, o.w. one that will make the test "hang"
    settings.put(DiscoverySettings.COMMIT_TIMEOUT_SETTING.getKey(), expectingToCommit == false && timeOutNodes > 0 ? "100ms" : "1h").put(DiscoverySettings.PUBLISH_TIMEOUT_SETTING.getKey(), // test is about committing
    "5ms");
    MockNode master = createMockNode("master", settings.build(), null);
    // randomize things a bit
    int[] nodeTypes = new int[goodNodes + errorNodes + timeOutNodes];
    for (int i = 0; i < goodNodes; i++) {
        nodeTypes[i] = 0;
    }
    for (int i = goodNodes; i < goodNodes + errorNodes; i++) {
        nodeTypes[i] = 1;
    }
    for (int i = goodNodes + errorNodes; i < nodeTypes.length; i++) {
        nodeTypes[i] = 2;
    }
    Collections.shuffle(Arrays.asList(nodeTypes), random());
    DiscoveryNodes.Builder discoveryNodesBuilder = DiscoveryNodes.builder().add(master.discoveryNode);
    for (int i = 0; i < nodeTypes.length; i++) {
        final MockNode mockNode = createMockNode("node" + i);
        discoveryNodesBuilder.add(mockNode.discoveryNode);
        switch(nodeTypes[i]) {
            case 1:
                mockNode.action.errorOnSend.set(true);
                break;
            case 2:
                mockNode.action.timeoutOnSend.set(true);
                break;
        }
    }
    // data nodes don't matter
    final int dataNodes = randomIntBetween(0, 3);
    for (int i = 0; i < dataNodes; i++) {
        final MockNode mockNode = createMockNode("data_" + i, Settings.builder().put(Node.NODE_MASTER_SETTING.getKey(), false).build(), null);
        discoveryNodesBuilder.add(mockNode.discoveryNode);
        if (randomBoolean()) {
            // we really don't care - just chaos monkey
            mockNode.action.errorOnCommit.set(randomBoolean());
            mockNode.action.errorOnSend.set(randomBoolean());
            mockNode.action.timeoutOnCommit.set(randomBoolean());
            mockNode.action.timeoutOnSend.set(randomBoolean());
        }
    }
    final int minMasterNodes;
    final String expectedBehavior;
    if (expectingToCommit) {
        // count master
        minMasterNodes = randomIntBetween(0, goodNodes + 1);
        expectedBehavior = "succeed";
    } else {
        // +2 because of master
        minMasterNodes = randomIntBetween(goodNodes + 2, numberOfMasterNodes);
        expectedBehavior = timeOutNodes > 0 ? "timeout" : "fail";
    }
    logger.info("--> expecting commit to {}. good nodes [{}], errors [{}], timeouts [{}]. min_master_nodes [{}]", expectedBehavior, goodNodes + 1, errorNodes, timeOutNodes, minMasterNodes);
    discoveryNodesBuilder.localNodeId(master.discoveryNode.getId()).masterNodeId(master.discoveryNode.getId());
    DiscoveryNodes discoveryNodes = discoveryNodesBuilder.build();
    MetaData metaData = MetaData.EMPTY_META_DATA;
    ClusterState clusterState = ClusterState.builder(CLUSTER_NAME).metaData(metaData).nodes(discoveryNodes).build();
    ClusterState previousState = master.clusterState;
    try {
        publishState(master.action, clusterState, previousState, minMasterNodes);
        if (expectingToCommit == false) {
            fail("cluster state publishing didn't fail despite of not have enough nodes");
        }
    } catch (Discovery.FailedToCommitClusterStateException exception) {
        logger.debug("failed to publish as expected", exception);
        if (expectingToCommit) {
            throw exception;
        }
        assertThat(exception.getMessage(), containsString(timeOutNodes > 0 ? "timed out" : "failed"));
    }
}
Also used : ClusterState(org.elasticsearch.cluster.ClusterState) Discovery(org.elasticsearch.discovery.Discovery) Matchers.hasToString(org.hamcrest.Matchers.hasToString) Matchers.containsString(org.hamcrest.Matchers.containsString) MetaData(org.elasticsearch.cluster.metadata.MetaData) IndexMetaData(org.elasticsearch.cluster.metadata.IndexMetaData) Settings(org.elasticsearch.common.settings.Settings) DiscoverySettings(org.elasticsearch.discovery.DiscoverySettings) ClusterSettings(org.elasticsearch.common.settings.ClusterSettings) DiscoveryNodes(org.elasticsearch.cluster.node.DiscoveryNodes)

Example 80 with DiscoveryNodes

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

the class UnicastZenPingTests method testSimplePings.

public void testSimplePings() throws IOException, InterruptedException, ExecutionException {
    // use ephemeral ports
    final Settings settings = Settings.builder().put("cluster.name", "test").put(TransportSettings.PORT.getKey(), 0).build();
    final Settings settingsMismatch = Settings.builder().put(settings).put("cluster.name", "mismatch").put(TransportSettings.PORT.getKey(), 0).build();
    NetworkService networkService = new NetworkService(settings, Collections.emptyList());
    final BiFunction<Settings, Version, Transport> supplier = (s, v) -> new MockTcpTransport(s, threadPool, BigArrays.NON_RECYCLING_INSTANCE, new NoneCircuitBreakerService(), new NamedWriteableRegistry(Collections.emptyList()), networkService, v) {

        @Override
        public void connectToNode(DiscoveryNode node, ConnectionProfile connectionProfile, CheckedBiConsumer<Connection, ConnectionProfile, IOException> connectionValidator) throws ConnectTransportException {
            throw new AssertionError("zen pings should never connect to node (got [" + node + "])");
        }
    };
    NetworkHandle handleA = startServices(settings, threadPool, "UZP_A", Version.CURRENT, supplier);
    closeables.push(handleA.transportService);
    NetworkHandle handleB = startServices(settings, threadPool, "UZP_B", Version.CURRENT, supplier);
    closeables.push(handleB.transportService);
    NetworkHandle handleC = startServices(settingsMismatch, threadPool, "UZP_C", Version.CURRENT, supplier);
    closeables.push(handleC.transportService);
    final Version versionD;
    if (randomBoolean()) {
        versionD = VersionUtils.randomVersionBetween(random(), Version.CURRENT.minimumCompatibilityVersion(), Version.CURRENT);
    } else {
        versionD = Version.CURRENT;
    }
    logger.info("UZP_D version set to [{}]", versionD);
    NetworkHandle handleD = startServices(settingsMismatch, threadPool, "UZP_D", versionD, supplier);
    closeables.push(handleD.transportService);
    final ClusterState state = ClusterState.builder(new ClusterName("test")).version(randomNonNegativeLong()).build();
    final ClusterState stateMismatch = ClusterState.builder(new ClusterName("mismatch")).version(randomNonNegativeLong()).build();
    Settings hostsSettings = Settings.builder().putArray("discovery.zen.ping.unicast.hosts", NetworkAddress.format(new InetSocketAddress(handleA.address.address().getAddress(), handleA.address.address().getPort())), NetworkAddress.format(new InetSocketAddress(handleB.address.address().getAddress(), handleB.address.address().getPort())), NetworkAddress.format(new InetSocketAddress(handleC.address.address().getAddress(), handleC.address.address().getPort())), NetworkAddress.format(new InetSocketAddress(handleD.address.address().getAddress(), handleD.address.address().getPort()))).put("cluster.name", "test").build();
    Settings hostsSettingsMismatch = Settings.builder().put(hostsSettings).put(settingsMismatch).build();
    TestUnicastZenPing zenPingA = new TestUnicastZenPing(hostsSettings, threadPool, handleA, EMPTY_HOSTS_PROVIDER);
    zenPingA.start(new PingContextProvider() {

        @Override
        public DiscoveryNodes nodes() {
            return DiscoveryNodes.builder().add(handleA.node).localNodeId("UZP_A").build();
        }

        @Override
        public ClusterState clusterState() {
            return ClusterState.builder(state).blocks(ClusterBlocks.builder().addGlobalBlock(STATE_NOT_RECOVERED_BLOCK)).build();
        }
    });
    closeables.push(zenPingA);
    TestUnicastZenPing zenPingB = new TestUnicastZenPing(hostsSettings, threadPool, handleB, EMPTY_HOSTS_PROVIDER);
    zenPingB.start(new PingContextProvider() {

        @Override
        public DiscoveryNodes nodes() {
            return DiscoveryNodes.builder().add(handleB.node).localNodeId("UZP_B").build();
        }

        @Override
        public ClusterState clusterState() {
            return state;
        }
    });
    closeables.push(zenPingB);
    TestUnicastZenPing zenPingC = new TestUnicastZenPing(hostsSettingsMismatch, threadPool, handleC, EMPTY_HOSTS_PROVIDER) {

        @Override
        protected Version getVersion() {
            return versionD;
        }
    };
    zenPingC.start(new PingContextProvider() {

        @Override
        public DiscoveryNodes nodes() {
            return DiscoveryNodes.builder().add(handleC.node).localNodeId("UZP_C").build();
        }

        @Override
        public ClusterState clusterState() {
            return stateMismatch;
        }
    });
    closeables.push(zenPingC);
    TestUnicastZenPing zenPingD = new TestUnicastZenPing(hostsSettingsMismatch, threadPool, handleD, EMPTY_HOSTS_PROVIDER);
    zenPingD.start(new PingContextProvider() {

        @Override
        public DiscoveryNodes nodes() {
            return DiscoveryNodes.builder().add(handleD.node).localNodeId("UZP_D").build();
        }

        @Override
        public ClusterState clusterState() {
            return stateMismatch;
        }
    });
    closeables.push(zenPingD);
    logger.info("ping from UZP_A");
    Collection<ZenPing.PingResponse> pingResponses = zenPingA.pingAndWait().toList();
    assertThat(pingResponses.size(), equalTo(1));
    ZenPing.PingResponse ping = pingResponses.iterator().next();
    assertThat(ping.node().getId(), equalTo("UZP_B"));
    assertThat(ping.getClusterStateVersion(), equalTo(state.version()));
    assertPingCount(handleA, handleB, 3);
    // mismatch, shouldn't ping
    assertPingCount(handleA, handleC, 0);
    // mismatch, shouldn't ping
    assertPingCount(handleA, handleD, 0);
    // ping again, this time from B,
    logger.info("ping from UZP_B");
    pingResponses = zenPingB.pingAndWait().toList();
    assertThat(pingResponses.size(), equalTo(1));
    ping = pingResponses.iterator().next();
    assertThat(ping.node().getId(), equalTo("UZP_A"));
    assertThat(ping.getClusterStateVersion(), equalTo(ElectMasterService.MasterCandidate.UNRECOVERED_CLUSTER_VERSION));
    assertPingCount(handleB, handleA, 3);
    // mismatch, shouldn't ping
    assertPingCount(handleB, handleC, 0);
    // mismatch, shouldn't ping
    assertPingCount(handleB, handleD, 0);
    logger.info("ping from UZP_C");
    pingResponses = zenPingC.pingAndWait().toList();
    assertThat(pingResponses.size(), equalTo(1));
    assertPingCount(handleC, handleA, 0);
    assertPingCount(handleC, handleB, 0);
    assertPingCount(handleC, handleD, 3);
    logger.info("ping from UZP_D");
    pingResponses = zenPingD.pingAndWait().toList();
    assertThat(pingResponses.size(), equalTo(1));
    assertPingCount(handleD, handleA, 0);
    assertPingCount(handleD, handleB, 0);
    assertPingCount(handleD, handleC, 3);
}
Also used : 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) NamedWriteableRegistry(org.elasticsearch.common.io.stream.NamedWriteableRegistry) DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) CheckedBiConsumer(org.elasticsearch.common.CheckedBiConsumer) InetSocketAddress(java.net.InetSocketAddress) MockTcpTransport(org.elasticsearch.transport.MockTcpTransport) Version(org.elasticsearch.Version) ClusterName(org.elasticsearch.cluster.ClusterName) Settings(org.elasticsearch.common.settings.Settings) TransportSettings(org.elasticsearch.transport.TransportSettings) DiscoveryNodes(org.elasticsearch.cluster.node.DiscoveryNodes) ClusterState(org.elasticsearch.cluster.ClusterState) ConnectionProfile(org.elasticsearch.transport.ConnectionProfile) NetworkService(org.elasticsearch.common.network.NetworkService) Transport(org.elasticsearch.transport.Transport) MockTcpTransport(org.elasticsearch.transport.MockTcpTransport) NoneCircuitBreakerService(org.elasticsearch.indices.breaker.NoneCircuitBreakerService)

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