Search in sources :

Example 36 with ClusterService

use of org.elasticsearch.cluster.service.ClusterService 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 37 with ClusterService

use of org.elasticsearch.cluster.service.ClusterService in project elasticsearch by elastic.

the class DiscoveryWithServiceDisruptionsIT method testSendingShardFailure.

// simulate handling of sending shard failure during an isolation
public void testSendingShardFailure() throws Exception {
    List<String> nodes = startCluster(3, 2);
    String masterNode = internalCluster().getMasterName();
    List<String> nonMasterNodes = nodes.stream().filter(node -> !node.equals(masterNode)).collect(Collectors.toList());
    String nonMasterNode = randomFrom(nonMasterNodes);
    assertAcked(prepareCreate("test").setSettings(Settings.builder().put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 3).put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 2)));
    ensureGreen();
    String nonMasterNodeId = internalCluster().clusterService(nonMasterNode).localNode().getId();
    // fail a random shard
    ShardRouting failedShard = randomFrom(clusterService().state().getRoutingNodes().node(nonMasterNodeId).shardsWithState(ShardRoutingState.STARTED));
    ShardStateAction service = internalCluster().getInstance(ShardStateAction.class, nonMasterNode);
    CountDownLatch latch = new CountDownLatch(1);
    AtomicBoolean success = new AtomicBoolean();
    String isolatedNode = randomBoolean() ? masterNode : nonMasterNode;
    TwoPartitions partitions = isolateNode(isolatedNode);
    // we cannot use the NetworkUnresponsive disruption type here as it will swallow the "shard failed" request, calling neither
    // onSuccess nor onFailure on the provided listener.
    NetworkLinkDisruptionType disruptionType = new NetworkDisconnect();
    NetworkDisruption networkDisruption = new NetworkDisruption(partitions, disruptionType);
    setDisruptionScheme(networkDisruption);
    networkDisruption.startDisrupting();
    service.localShardFailed(failedShard, "simulated", new CorruptIndexException("simulated", (String) null), new ShardStateAction.Listener() {

        @Override
        public void onSuccess() {
            success.set(true);
            latch.countDown();
        }

        @Override
        public void onFailure(Exception e) {
            success.set(false);
            latch.countDown();
            assert false;
        }
    });
    if (isolatedNode.equals(nonMasterNode)) {
        assertNoMaster(nonMasterNode);
    } else {
        ensureStableCluster(2, nonMasterNode);
    }
    // heal the partition
    networkDisruption.removeAndEnsureHealthy(internalCluster());
    // the cluster should stabilize
    ensureStableCluster(3);
    latch.await();
    // the listener should be notified
    assertTrue(success.get());
    // the failed shard should be gone
    List<ShardRouting> shards = clusterService().state().getRoutingTable().allShards("test");
    for (ShardRouting shard : shards) {
        assertThat(shard.allocationId(), not(equalTo(failedShard.allocationId())));
    }
}
Also used : Arrays(java.util.Arrays) Nullable(org.elasticsearch.common.Nullable) ZenDiscovery(org.elasticsearch.discovery.zen.ZenDiscovery) Matchers.not(org.hamcrest.Matchers.not) ZenPing(org.elasticsearch.discovery.zen.ZenPing) ClusterState(org.elasticsearch.cluster.ClusterState) ClusterStateUpdateTask(org.elasticsearch.cluster.ClusterStateUpdateTask) Scope(org.elasticsearch.test.ESIntegTestCase.Scope) ClusterBlock(org.elasticsearch.cluster.block.ClusterBlock) SlowClusterStateProcessing(org.elasticsearch.test.disruption.SlowClusterStateProcessing) Map(java.util.Map) Matchers.nullValue(org.hamcrest.Matchers.nullValue) ServiceDisruptionScheme(org.elasticsearch.test.disruption.ServiceDisruptionScheme) Priority(org.elasticsearch.common.Priority) TestLogging(org.elasticsearch.test.junit.annotations.TestLogging) Set(java.util.Set) ClusterDiscoveryConfiguration(org.elasticsearch.test.discovery.ClusterDiscoveryConfiguration) CountDownLatch(java.util.concurrent.CountDownLatch) Supplier(org.apache.logging.log4j.util.Supplier) IndexMetaData(org.elasticsearch.cluster.metadata.IndexMetaData) ShardStateAction(org.elasticsearch.cluster.action.shard.ShardStateAction) IntermittentLongGCDisruption(org.elasticsearch.test.disruption.IntermittentLongGCDisruption) Matchers.is(org.hamcrest.Matchers.is) TransportRequestOptions(org.elasticsearch.transport.TransportRequestOptions) TestZenDiscovery(org.elasticsearch.test.discovery.TestZenDiscovery) ClusterService(org.elasticsearch.cluster.service.ClusterService) ShardRoutingState(org.elasticsearch.cluster.routing.ShardRoutingState) MembershipAction(org.elasticsearch.discovery.zen.MembershipAction) ArrayList(java.util.ArrayList) DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) TcpTransport(org.elasticsearch.transport.TcpTransport) IndicesStoreIntegrationIT(org.elasticsearch.indices.store.IndicesStoreIntegrationIT) TransportService(org.elasticsearch.transport.TransportService) Before(org.junit.Before) ConnectionProfile(org.elasticsearch.transport.ConnectionProfile) DiscoveryNodes(org.elasticsearch.cluster.node.DiscoveryNodes) ClusterScope(org.elasticsearch.test.ESIntegTestCase.ClusterScope) Matchers.greaterThanOrEqualTo(org.hamcrest.Matchers.greaterThanOrEqualTo) Client(org.elasticsearch.client.Client) IOException(java.io.IOException) DocWriteResponse(org.elasticsearch.action.DocWriteResponse) ExecutionException(java.util.concurrent.ExecutionException) NetworkDisconnect(org.elasticsearch.test.disruption.NetworkDisruption.NetworkDisconnect) Tuple(org.elasticsearch.common.collect.Tuple) NetworkDelay(org.elasticsearch.test.disruption.NetworkDisruption.NetworkDelay) ElasticsearchAssertions.assertAcked(org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked) ElasticsearchException(org.elasticsearch.ElasticsearchException) GetResponse(org.elasticsearch.action.get.GetResponse) UnicastZenPing(org.elasticsearch.discovery.zen.UnicastZenPing) NetworkDisruption(org.elasticsearch.test.disruption.NetworkDisruption) TransportRequest(org.elasticsearch.transport.TransportRequest) CorruptIndexException(org.apache.lucene.index.CorruptIndexException) Settings(org.elasticsearch.common.settings.Settings) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) LongGCDisruption(org.elasticsearch.test.disruption.LongGCDisruption) XContentFactory.jsonBuilder(org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder) Bridge(org.elasticsearch.test.disruption.NetworkDisruption.Bridge) Collection(java.util.Collection) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HotThreads(org.elasticsearch.monitor.jvm.HotThreads) Collectors(java.util.stream.Collectors) Objects(java.util.Objects) List(java.util.List) IndexRequestBuilder(org.elasticsearch.action.index.IndexRequestBuilder) ESIntegTestCase(org.elasticsearch.test.ESIntegTestCase) NetworkUnresponsive(org.elasticsearch.test.disruption.NetworkDisruption.NetworkUnresponsive) INDEX_NUMBER_OF_REPLICAS_SETTING(org.elasticsearch.cluster.metadata.IndexMetaData.INDEX_NUMBER_OF_REPLICAS_SETTING) PublishClusterStateAction(org.elasticsearch.discovery.zen.PublishClusterStateAction) Matchers.equalTo(org.hamcrest.Matchers.equalTo) ElectMasterService(org.elasticsearch.discovery.zen.ElectMasterService) ShardRouting(org.elasticsearch.cluster.routing.ShardRouting) InternalTestCluster(org.elasticsearch.test.InternalTestCluster) XContentType(org.elasticsearch.common.xcontent.XContentType) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) ParameterizedMessage(org.apache.logging.log4j.message.ParameterizedMessage) FaultDetection(org.elasticsearch.discovery.zen.FaultDetection) AtomicReference(java.util.concurrent.atomic.AtomicReference) Strings(org.elasticsearch.common.Strings) HashSet(java.util.HashSet) TimeValue(org.elasticsearch.common.unit.TimeValue) IndexSettings(org.elasticsearch.index.IndexSettings) IndexResponse(org.elasticsearch.action.index.IndexResponse) MockTransportService(org.elasticsearch.test.transport.MockTransportService) ClusterBlockLevel(org.elasticsearch.cluster.block.ClusterBlockLevel) TwoPartitions(org.elasticsearch.test.disruption.NetworkDisruption.TwoPartitions) INDEX_NUMBER_OF_SHARDS_SETTING(org.elasticsearch.cluster.metadata.IndexMetaData.INDEX_NUMBER_OF_SHARDS_SETTING) DisruptedLinks(org.elasticsearch.test.disruption.NetworkDisruption.DisruptedLinks) Semaphore(java.util.concurrent.Semaphore) NetworkLinkDisruptionType(org.elasticsearch.test.disruption.NetworkDisruption.NetworkLinkDisruptionType) Plugin(org.elasticsearch.plugins.Plugin) NoShardAvailableActionException(org.elasticsearch.action.NoShardAvailableActionException) Murmur3HashFunction(org.elasticsearch.cluster.routing.Murmur3HashFunction) TimeUnit(java.util.concurrent.TimeUnit) SingleNodeDisruption(org.elasticsearch.test.disruption.SingleNodeDisruption) NodeEnvironment(org.elasticsearch.env.NodeEnvironment) Collections(java.util.Collections) NetworkLinkDisruptionType(org.elasticsearch.test.disruption.NetworkDisruption.NetworkLinkDisruptionType) TwoPartitions(org.elasticsearch.test.disruption.NetworkDisruption.TwoPartitions) CorruptIndexException(org.apache.lucene.index.CorruptIndexException) ShardStateAction(org.elasticsearch.cluster.action.shard.ShardStateAction) CountDownLatch(java.util.concurrent.CountDownLatch) NetworkDisconnect(org.elasticsearch.test.disruption.NetworkDisruption.NetworkDisconnect) IOException(java.io.IOException) ExecutionException(java.util.concurrent.ExecutionException) ElasticsearchException(org.elasticsearch.ElasticsearchException) CorruptIndexException(org.apache.lucene.index.CorruptIndexException) NoShardAvailableActionException(org.elasticsearch.action.NoShardAvailableActionException) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) ShardRouting(org.elasticsearch.cluster.routing.ShardRouting) NetworkDisruption(org.elasticsearch.test.disruption.NetworkDisruption)

Example 38 with ClusterService

use of org.elasticsearch.cluster.service.ClusterService in project elasticsearch by elastic.

the class ZenDiscoveryIT method testNodeFailuresAreProcessedOnce.

public void testNodeFailuresAreProcessedOnce() throws ExecutionException, InterruptedException, IOException {
    Settings defaultSettings = Settings.builder().put(FaultDetection.PING_TIMEOUT_SETTING.getKey(), "1s").put(FaultDetection.PING_RETRIES_SETTING.getKey(), "1").build();
    Settings masterNodeSettings = Settings.builder().put(Node.NODE_DATA_SETTING.getKey(), false).put(defaultSettings).build();
    String master = internalCluster().startNode(masterNodeSettings);
    Settings dateNodeSettings = Settings.builder().put(Node.NODE_MASTER_SETTING.getKey(), false).put(defaultSettings).build();
    internalCluster().startNodes(2, dateNodeSettings);
    client().admin().cluster().prepareHealth().setWaitForNodes("3").get();
    ClusterService clusterService = internalCluster().getInstance(ClusterService.class, master);
    final ArrayList<ClusterState> statesFound = new ArrayList<>();
    final CountDownLatch nodesStopped = new CountDownLatch(1);
    clusterService.addStateApplier(event -> {
        statesFound.add(event.state());
        try {
            nodesStopped.await();
        } catch (InterruptedException e) {
        }
    });
    internalCluster().stopRandomNonMasterNode();
    internalCluster().stopRandomNonMasterNode();
    nodesStopped.countDown();
    // wait for all to be processed
    client().admin().cluster().prepareHealth().setWaitForEvents(Priority.LANGUID).get();
    assertThat(statesFound, Matchers.hasSize(2));
}
Also used : ClusterState(org.elasticsearch.cluster.ClusterState) ClusterService(org.elasticsearch.cluster.service.ClusterService) ArrayList(java.util.ArrayList) Matchers.containsString(org.hamcrest.Matchers.containsString) CountDownLatch(java.util.concurrent.CountDownLatch) Settings(org.elasticsearch.common.settings.Settings)

Example 39 with ClusterService

use of org.elasticsearch.cluster.service.ClusterService in project elasticsearch by elastic.

the class ZenDiscoveryUnitTests method testNodesUpdatedAfterClusterStatePublished.

public void testNodesUpdatedAfterClusterStatePublished() throws Exception {
    ThreadPool threadPool = new TestThreadPool(getClass().getName());
    // randomly make minimum_master_nodes a value higher than we have nodes for, so it will force failure
    int minMasterNodes = randomBoolean() ? 3 : 1;
    Settings settings = Settings.builder().put(DISCOVERY_ZEN_MINIMUM_MASTER_NODES_SETTING.getKey(), Integer.toString(minMasterNodes)).build();
    ArrayDeque<Closeable> toClose = new ArrayDeque<>();
    try {
        Set<DiscoveryNode> expectedFDNodes = null;
        final MockTransportService masterTransport = MockTransportService.createNewService(settings, Version.CURRENT, threadPool, null);
        masterTransport.start();
        DiscoveryNode masterNode = masterTransport.getLocalNode();
        toClose.addFirst(masterTransport);
        ClusterState state = ClusterStateCreationUtils.state(masterNode, masterNode, masterNode);
        // build the zen discovery and cluster service
        ClusterService masterClusterService = createClusterService(threadPool, masterNode);
        toClose.addFirst(masterClusterService);
        // TODO: clustername shouldn't be stored twice in cluster service, but for now, work around it
        state = ClusterState.builder(masterClusterService.getClusterName()).nodes(state.nodes()).build();
        setState(masterClusterService, state);
        ZenDiscovery masterZen = buildZenDiscovery(settings, masterTransport, masterClusterService, threadPool);
        toClose.addFirst(masterZen);
        masterTransport.acceptIncomingRequests();
        final MockTransportService otherTransport = MockTransportService.createNewService(settings, Version.CURRENT, threadPool, null);
        otherTransport.start();
        toClose.addFirst(otherTransport);
        DiscoveryNode otherNode = otherTransport.getLocalNode();
        final ClusterState otherState = ClusterState.builder(masterClusterService.getClusterName()).nodes(DiscoveryNodes.builder().add(otherNode).localNodeId(otherNode.getId())).build();
        ClusterService otherClusterService = createClusterService(threadPool, masterNode);
        toClose.addFirst(otherClusterService);
        setState(otherClusterService, otherState);
        ZenDiscovery otherZen = buildZenDiscovery(settings, otherTransport, otherClusterService, threadPool);
        toClose.addFirst(otherZen);
        otherTransport.acceptIncomingRequests();
        masterTransport.connectToNode(otherNode);
        otherTransport.connectToNode(masterNode);
        // a new cluster state with a new discovery node (we will test if the cluster state
        // was updated by the presence of this node in NodesFaultDetection)
        ClusterState newState = ClusterState.builder(masterClusterService.state()).incrementVersion().nodes(DiscoveryNodes.builder(state.nodes()).add(otherNode).masterNodeId(masterNode.getId())).build();
        try {
            // publishing a new cluster state
            ClusterChangedEvent clusterChangedEvent = new ClusterChangedEvent("testing", newState, state);
            AssertingAckListener listener = new AssertingAckListener(newState.nodes().getSize() - 1);
            expectedFDNodes = masterZen.getFaultDetectionNodes();
            masterZen.publish(clusterChangedEvent, listener);
            listener.await(1, TimeUnit.HOURS);
            // publish was a success, update expected FD nodes based on new cluster state
            expectedFDNodes = fdNodesForState(newState, masterNode);
        } catch (Discovery.FailedToCommitClusterStateException e) {
            // not successful, so expectedFDNodes above should remain what it was originally assigned
            // ensure min master nodes is the higher value, otherwise we shouldn't fail
            assertEquals(3, minMasterNodes);
        }
        assertEquals(expectedFDNodes, masterZen.getFaultDetectionNodes());
    } finally {
        IOUtils.close(toClose);
        terminate(threadPool);
    }
}
Also used : ClusterState(org.elasticsearch.cluster.ClusterState) ZenDiscovery.shouldIgnoreOrRejectNewClusterState(org.elasticsearch.discovery.zen.ZenDiscovery.shouldIgnoreOrRejectNewClusterState) DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) MockTransportService(org.elasticsearch.test.transport.MockTransportService) Closeable(java.io.Closeable) ThreadPool(org.elasticsearch.threadpool.ThreadPool) TestThreadPool(org.elasticsearch.threadpool.TestThreadPool) Discovery(org.elasticsearch.discovery.Discovery) ClusterChangedEvent(org.elasticsearch.cluster.ClusterChangedEvent) TestThreadPool(org.elasticsearch.threadpool.TestThreadPool) ArrayDeque(java.util.ArrayDeque) ClusterServiceUtils.createClusterService(org.elasticsearch.test.ClusterServiceUtils.createClusterService) ClusterService(org.elasticsearch.cluster.service.ClusterService) AssertingAckListener(org.elasticsearch.discovery.zen.PublishClusterStateActionTests.AssertingAckListener) Settings(org.elasticsearch.common.settings.Settings)

Example 40 with ClusterService

use of org.elasticsearch.cluster.service.ClusterService in project elasticsearch by elastic.

the class IndicesClusterStateServiceRandomUpdatesTests method createIndicesClusterStateService.

private IndicesClusterStateService createIndicesClusterStateService(DiscoveryNode discoveryNode, final Supplier<MockIndicesService> indicesServiceSupplier) {
    final ThreadPool threadPool = mock(ThreadPool.class);
    when(threadPool.generic()).thenReturn(mock(ExecutorService.class));
    final MockIndicesService indicesService = indicesServiceSupplier.get();
    final Settings settings = Settings.builder().put("node.name", discoveryNode.getName()).build();
    final TransportService transportService = new TransportService(settings, null, threadPool, TransportService.NOOP_TRANSPORT_INTERCEPTOR, boundAddress -> DiscoveryNode.createLocal(settings, boundAddress.publishAddress(), UUIDs.randomBase64UUID()), null);
    final ClusterService clusterService = mock(ClusterService.class);
    final RepositoriesService repositoriesService = new RepositoriesService(settings, clusterService, transportService, null);
    final PeerRecoveryTargetService recoveryTargetService = new PeerRecoveryTargetService(settings, threadPool, transportService, null, clusterService);
    final ShardStateAction shardStateAction = mock(ShardStateAction.class);
    return new IndicesClusterStateService(settings, indicesService, clusterService, threadPool, recoveryTargetService, shardStateAction, null, repositoriesService, null, null, null, null, shardId -> {
    });
}
Also used : ClusterService(org.elasticsearch.cluster.service.ClusterService) PeerRecoveryTargetService(org.elasticsearch.indices.recovery.PeerRecoveryTargetService) TransportService(org.elasticsearch.transport.TransportService) RepositoriesService(org.elasticsearch.repositories.RepositoriesService) ThreadPool(org.elasticsearch.threadpool.ThreadPool) TestThreadPool(org.elasticsearch.threadpool.TestThreadPool) ExecutorService(java.util.concurrent.ExecutorService) ShardStateAction(org.elasticsearch.cluster.action.shard.ShardStateAction) Settings(org.elasticsearch.common.settings.Settings)

Aggregations

ClusterService (org.elasticsearch.cluster.service.ClusterService)52 ClusterState (org.elasticsearch.cluster.ClusterState)31 Settings (org.elasticsearch.common.settings.Settings)25 ThreadPool (org.elasticsearch.threadpool.ThreadPool)20 TransportService (org.elasticsearch.transport.TransportService)20 TestThreadPool (org.elasticsearch.threadpool.TestThreadPool)17 CountDownLatch (java.util.concurrent.CountDownLatch)15 IOException (java.io.IOException)13 DiscoveryNode (org.elasticsearch.cluster.node.DiscoveryNode)13 ActionFilters (org.elasticsearch.action.support.ActionFilters)12 IndexNameExpressionResolver (org.elasticsearch.cluster.metadata.IndexNameExpressionResolver)12 ClusterServiceUtils.createClusterService (org.elasticsearch.test.ClusterServiceUtils.createClusterService)12 Before (org.junit.Before)12 ShardId (org.elasticsearch.index.shard.ShardId)11 ArrayList (java.util.ArrayList)10 HashSet (java.util.HashSet)10 TimeUnit (java.util.concurrent.TimeUnit)10 ExecutionException (java.util.concurrent.ExecutionException)9 DiscoveryNodes (org.elasticsearch.cluster.node.DiscoveryNodes)9 ESTestCase (org.elasticsearch.test.ESTestCase)9