Search in sources :

Example 1 with ShardRoutingState

use of org.elasticsearch.cluster.routing.ShardRoutingState in project elasticsearch by elastic.

the class IndicesStoreTests method testShardCanBeDeletedNoShardStarted.

public void testShardCanBeDeletedNoShardStarted() throws Exception {
    int numShards = randomIntBetween(1, 7);
    int numReplicas = randomInt(2);
    IndexShardRoutingTable.Builder routingTable = new IndexShardRoutingTable.Builder(new ShardId("test", "_na_", 1));
    for (int i = 0; i < numShards; i++) {
        int unStartedShard = randomInt(numReplicas);
        for (int j = 0; j <= numReplicas; j++) {
            ShardRoutingState state;
            if (j == unStartedShard) {
                state = randomFrom(NOT_STARTED_STATES);
            } else {
                state = randomFrom(ShardRoutingState.values());
            }
            UnassignedInfo unassignedInfo = null;
            if (state == ShardRoutingState.UNASSIGNED) {
                unassignedInfo = new UnassignedInfo(UnassignedInfo.Reason.INDEX_CREATED, null);
            }
            String relocatingNodeId = state == ShardRoutingState.RELOCATING ? randomAsciiOfLength(10) : null;
            routingTable.addShard(TestShardRouting.newShardRouting("test", i, randomAsciiOfLength(10), relocatingNodeId, j == 0, state, unassignedInfo));
        }
    }
    assertFalse(IndicesStore.shardCanBeDeleted(localNode.getId(), routingTable.build()));
}
Also used : ShardId(org.elasticsearch.index.shard.ShardId) IndexShardRoutingTable(org.elasticsearch.cluster.routing.IndexShardRoutingTable) UnassignedInfo(org.elasticsearch.cluster.routing.UnassignedInfo) ShardRoutingState(org.elasticsearch.cluster.routing.ShardRoutingState)

Example 2 with ShardRoutingState

use of org.elasticsearch.cluster.routing.ShardRoutingState in project elasticsearch by elastic.

the class ClusterAllocationExplainActionTests method testFindShardAssignedToNode.

public void testFindShardAssignedToNode() {
    // find shard with given node
    final boolean primary = randomBoolean();
    ShardRoutingState[] replicaStates = new ShardRoutingState[0];
    if (primary == false) {
        replicaStates = new ShardRoutingState[] { ShardRoutingState.STARTED };
    }
    ClusterState clusterState = ClusterStateCreationUtils.state("idx", randomBoolean(), ShardRoutingState.STARTED, replicaStates);
    ShardRouting shardToExplain = primary ? clusterState.getRoutingTable().index("idx").shard(0).primaryShard() : clusterState.getRoutingTable().index("idx").shard(0).replicaShards().get(0);
    ClusterAllocationExplainRequest request = new ClusterAllocationExplainRequest("idx", 0, primary, shardToExplain.currentNodeId());
    RoutingAllocation allocation = routingAllocation(clusterState);
    ShardRouting foundShard = findShardToExplain(request, allocation);
    assertEquals(shardToExplain, foundShard);
    // shard is not assigned to given node
    String explainNode = null;
    for (RoutingNode routingNode : clusterState.getRoutingNodes()) {
        if (routingNode.nodeId().equals(shardToExplain.currentNodeId()) == false) {
            explainNode = routingNode.nodeId();
            break;
        }
    }
    final ClusterAllocationExplainRequest failingRequest = new ClusterAllocationExplainRequest("idx", 0, primary, explainNode);
    expectThrows(IllegalStateException.class, () -> findShardToExplain(failingRequest, allocation));
}
Also used : ClusterState(org.elasticsearch.cluster.ClusterState) RoutingNode(org.elasticsearch.cluster.routing.RoutingNode) ShardRoutingState(org.elasticsearch.cluster.routing.ShardRoutingState) ShardRouting(org.elasticsearch.cluster.routing.ShardRouting) RoutingAllocation(org.elasticsearch.cluster.routing.allocation.RoutingAllocation)

Example 3 with ShardRoutingState

use of org.elasticsearch.cluster.routing.ShardRoutingState in project elasticsearch by elastic.

the class ClusterAllocationExplainIT method testUnassignedReplicaDelayedAllocation.

public void testUnassignedReplicaDelayedAllocation() throws Exception {
    logger.info("--> starting 3 nodes");
    internalCluster().startNodes(3);
    logger.info("--> creating an index with 1 primary, 1 replica");
    createIndexAndIndexData(1, 1);
    logger.info("--> stopping the node with the replica");
    internalCluster().stopRandomNode(InternalTestCluster.nameFilter(replicaNode().getName()));
    ensureStableCluster(2);
    assertBusy(() -> assertEquals(AllocationDecision.ALLOCATION_DELAYED, client().admin().cluster().prepareAllocationExplain().setIndex("idx").setShard(0).setPrimary(false).get().getExplanation().getShardAllocationDecision().getAllocateDecision().getAllocationDecision()));
    logger.info("--> observing delayed allocation...");
    boolean includeYesDecisions = randomBoolean();
    boolean includeDiskInfo = randomBoolean();
    ClusterAllocationExplanation explanation = runExplain(false, includeYesDecisions, includeDiskInfo);
    ShardId shardId = explanation.getShard();
    boolean isPrimary = explanation.isPrimary();
    ShardRoutingState shardRoutingState = explanation.getShardState();
    DiscoveryNode currentNode = explanation.getCurrentNode();
    UnassignedInfo unassignedInfo = explanation.getUnassignedInfo();
    ClusterInfo clusterInfo = explanation.getClusterInfo();
    AllocateUnassignedDecision allocateDecision = explanation.getShardAllocationDecision().getAllocateDecision();
    MoveDecision moveDecision = explanation.getShardAllocationDecision().getMoveDecision();
    // verify shard info
    assertEquals("idx", shardId.getIndexName());
    assertEquals(0, shardId.getId());
    assertFalse(isPrimary);
    // verify current node info
    assertNotEquals(ShardRoutingState.STARTED, shardRoutingState);
    assertNull(currentNode);
    // verify unassigned info
    assertNotNull(unassignedInfo);
    assertEquals(Reason.NODE_LEFT, unassignedInfo.getReason());
    assertEquals(AllocationStatus.NO_ATTEMPT, unassignedInfo.getLastAllocationStatus());
    // verify cluster info
    verifyClusterInfo(clusterInfo, includeDiskInfo, 2);
    // verify decision objects
    assertTrue(allocateDecision.isDecisionTaken());
    assertFalse(moveDecision.isDecisionTaken());
    assertEquals(AllocationDecision.ALLOCATION_DELAYED, allocateDecision.getAllocationDecision());
    assertThat(allocateDecision.getExplanation(), startsWith("cannot allocate because the cluster is still waiting"));
    assertThat(allocateDecision.getExplanation(), containsString("despite being allowed to allocate the shard to at least one other node"));
    assertNull(allocateDecision.getAllocationId());
    assertNull(allocateDecision.getTargetNode());
    assertEquals(60000L, allocateDecision.getConfiguredDelayInMillis());
    assertThat(allocateDecision.getRemainingDelayInMillis(), greaterThan(0L));
    assertEquals(2, allocateDecision.getNodeDecisions().size());
    String primaryNodeName = primaryNodeName();
    for (NodeAllocationResult result : allocateDecision.getNodeDecisions()) {
        assertNotNull(result.getNode());
        boolean nodeHoldingPrimary = result.getNode().getName().equals(primaryNodeName);
        if (nodeHoldingPrimary) {
            // shouldn't be able to allocate to the same node as the primary, the same shard decider should say no
            assertEquals(AllocationDecision.NO, result.getNodeDecision());
            assertThat(result.getShardStoreInfo().getMatchingBytes(), greaterThan(0L));
        } else {
            assertEquals(AllocationDecision.YES, result.getNodeDecision());
            assertNull(result.getShardStoreInfo());
        }
        if (includeYesDecisions) {
            assertThat(result.getCanAllocateDecision().getDecisions().size(), greaterThan(1));
        } else {
            // if we are not including YES decisions, then the node holding the primary should have 1 NO decision,
            // the other node should have zero NO decisions
            assertEquals(nodeHoldingPrimary ? 1 : 0, result.getCanAllocateDecision().getDecisions().size());
        }
        for (Decision d : result.getCanAllocateDecision().getDecisions()) {
            if (d.label().equals("same_shard") && nodeHoldingPrimary) {
                assertEquals(Decision.Type.NO, d.type());
                assertThat(d.getExplanation(), startsWith("the shard cannot be allocated to the same node on which a copy of the shard already exists"));
            } else {
                assertEquals(Decision.Type.YES, d.type());
                assertNotNull(d.getExplanation());
            }
        }
    }
    // verify JSON output
    try (XContentParser parser = getParser(explanation)) {
        verifyShardInfo(parser, false, includeDiskInfo, ShardRoutingState.UNASSIGNED);
        parser.nextToken();
        assertEquals("can_allocate", parser.currentName());
        parser.nextToken();
        assertEquals(AllocationDecision.ALLOCATION_DELAYED.toString(), parser.text());
        parser.nextToken();
        assertEquals("allocate_explanation", parser.currentName());
        parser.nextToken();
        assertThat(parser.text(), startsWith("cannot allocate because the cluster is still waiting"));
        parser.nextToken();
        assertEquals("configured_delay_in_millis", parser.currentName());
        parser.nextToken();
        assertEquals(60000L, parser.longValue());
        parser.nextToken();
        assertEquals("remaining_delay_in_millis", parser.currentName());
        parser.nextToken();
        assertThat(parser.longValue(), greaterThan(0L));
        Map<String, AllocationDecision> nodes = new HashMap<>();
        nodes.put(primaryNodeName, AllocationDecision.NO);
        String[] currentNodes = internalCluster().getNodeNames();
        nodes.put(currentNodes[0].equals(primaryNodeName) ? currentNodes[1] : currentNodes[0], AllocationDecision.YES);
        verifyNodeDecisions(parser, nodes, includeYesDecisions, true);
        assertEquals(Token.END_OBJECT, parser.nextToken());
    }
}
Also used : DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) UnassignedInfo(org.elasticsearch.cluster.routing.UnassignedInfo) HashMap(java.util.HashMap) MoveDecision(org.elasticsearch.cluster.routing.allocation.MoveDecision) ShardRoutingState(org.elasticsearch.cluster.routing.ShardRoutingState) Matchers.containsString(org.hamcrest.Matchers.containsString) MoveDecision(org.elasticsearch.cluster.routing.allocation.MoveDecision) AllocationDecision(org.elasticsearch.cluster.routing.allocation.AllocationDecision) AllocateUnassignedDecision(org.elasticsearch.cluster.routing.allocation.AllocateUnassignedDecision) Decision(org.elasticsearch.cluster.routing.allocation.decider.Decision) ShardId(org.elasticsearch.index.shard.ShardId) ClusterInfo(org.elasticsearch.cluster.ClusterInfo) AllocationDecision(org.elasticsearch.cluster.routing.allocation.AllocationDecision) AllocateUnassignedDecision(org.elasticsearch.cluster.routing.allocation.AllocateUnassignedDecision) NodeAllocationResult(org.elasticsearch.cluster.routing.allocation.NodeAllocationResult) XContentParser(org.elasticsearch.common.xcontent.XContentParser)

Example 4 with ShardRoutingState

use of org.elasticsearch.cluster.routing.ShardRoutingState in project elasticsearch by elastic.

the class ClusterAllocationExplainIT method testAssignedReplicaOnSpecificNode.

public void testAssignedReplicaOnSpecificNode() throws Exception {
    logger.info("--> starting 3 nodes");
    List<String> nodes = internalCluster().startNodes(3);
    logger.info("--> creating an index with 1 primary and 2 replicas");
    String excludedNode = nodes.get(randomIntBetween(0, 2));
    createIndexAndIndexData(1, 2, Settings.builder().put("index.routing.allocation.exclude._name", excludedNode).build(), ActiveShardCount.from(2));
    boolean includeYesDecisions = randomBoolean();
    boolean includeDiskInfo = randomBoolean();
    ClusterAllocationExplanation explanation = runExplain(false, replicaNode().getId(), includeYesDecisions, includeDiskInfo);
    ShardId shardId = explanation.getShard();
    boolean isPrimary = explanation.isPrimary();
    ShardRoutingState shardRoutingState = explanation.getShardState();
    DiscoveryNode currentNode = explanation.getCurrentNode();
    UnassignedInfo unassignedInfo = explanation.getUnassignedInfo();
    ClusterInfo clusterInfo = explanation.getClusterInfo();
    AllocateUnassignedDecision allocateDecision = explanation.getShardAllocationDecision().getAllocateDecision();
    MoveDecision moveDecision = explanation.getShardAllocationDecision().getMoveDecision();
    // verify shard info
    assertEquals("idx", shardId.getIndexName());
    assertEquals(0, shardId.getId());
    assertFalse(isPrimary);
    // verify current node info
    assertEquals(ShardRoutingState.STARTED, shardRoutingState);
    assertNotNull(currentNode);
    assertEquals(replicaNode().getName(), currentNode.getName());
    // verify unassigned info
    assertNull(unassignedInfo);
    // verify cluster info
    verifyClusterInfo(clusterInfo, includeDiskInfo, 3);
    // verify decision objects
    assertFalse(allocateDecision.isDecisionTaken());
    assertTrue(moveDecision.isDecisionTaken());
    assertEquals(AllocationDecision.NO, moveDecision.getAllocationDecision());
    assertEquals("rebalancing is not allowed", moveDecision.getExplanation());
    assertTrue(moveDecision.canRemain());
    assertFalse(moveDecision.forceMove());
    assertFalse(moveDecision.canRebalanceCluster());
    assertNotNull(moveDecision.getCanRemainDecision());
    assertNull(moveDecision.getTargetNode());
    // verifying cluster rebalance decision object
    assertNotNull(moveDecision.getClusterRebalanceDecision());
    assertEquals(Decision.Type.NO, moveDecision.getClusterRebalanceDecision().type());
    // verify node decisions
    assertEquals(2, moveDecision.getNodeDecisions().size());
    for (NodeAllocationResult result : moveDecision.getNodeDecisions()) {
        assertNotNull(result.getNode());
        assertEquals(1, result.getWeightRanking());
        assertEquals(AllocationDecision.NO, result.getNodeDecision());
        if (includeYesDecisions) {
            assertThat(result.getCanAllocateDecision().getDecisions().size(), greaterThan(1));
        } else {
            assertEquals(1, result.getCanAllocateDecision().getDecisions().size());
        }
        for (Decision d : result.getCanAllocateDecision().getDecisions()) {
            if (d.type() == Decision.Type.NO) {
                assertThat(d.label(), isOneOf("filter", "same_shard"));
            }
            assertNotNull(d.getExplanation());
        }
    }
    // verify JSON output
    try (XContentParser parser = getParser(explanation)) {
        verifyShardInfo(parser, false, includeDiskInfo, ShardRoutingState.STARTED);
        parser.nextToken();
        assertEquals("can_remain_on_current_node", parser.currentName());
        parser.nextToken();
        assertEquals(AllocationDecision.YES.toString(), parser.text());
        parser.nextToken();
        assertEquals("can_rebalance_cluster", parser.currentName());
        parser.nextToken();
        assertEquals(AllocationDecision.NO.toString(), parser.text());
        parser.nextToken();
        assertEquals("can_rebalance_cluster_decisions", parser.currentName());
        verifyDeciders(parser, AllocationDecision.NO);
        parser.nextToken();
        assertEquals("can_rebalance_to_other_node", parser.currentName());
        parser.nextToken();
        assertEquals(AllocationDecision.NO.toString(), parser.text());
        parser.nextToken();
        assertEquals("rebalance_explanation", parser.currentName());
        parser.nextToken();
        assertEquals("rebalancing is not allowed", parser.text());
        verifyNodeDecisions(parser, allNodeDecisions(AllocationDecision.NO, false), includeYesDecisions, false);
        assertEquals(Token.END_OBJECT, parser.nextToken());
    }
}
Also used : DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) UnassignedInfo(org.elasticsearch.cluster.routing.UnassignedInfo) MoveDecision(org.elasticsearch.cluster.routing.allocation.MoveDecision) Matchers.containsString(org.hamcrest.Matchers.containsString) ShardRoutingState(org.elasticsearch.cluster.routing.ShardRoutingState) MoveDecision(org.elasticsearch.cluster.routing.allocation.MoveDecision) AllocationDecision(org.elasticsearch.cluster.routing.allocation.AllocationDecision) AllocateUnassignedDecision(org.elasticsearch.cluster.routing.allocation.AllocateUnassignedDecision) Decision(org.elasticsearch.cluster.routing.allocation.decider.Decision) ShardId(org.elasticsearch.index.shard.ShardId) ClusterInfo(org.elasticsearch.cluster.ClusterInfo) AllocateUnassignedDecision(org.elasticsearch.cluster.routing.allocation.AllocateUnassignedDecision) NodeAllocationResult(org.elasticsearch.cluster.routing.allocation.NodeAllocationResult) XContentParser(org.elasticsearch.common.xcontent.XContentParser)

Example 5 with ShardRoutingState

use of org.elasticsearch.cluster.routing.ShardRoutingState in project elasticsearch by elastic.

the class ClusterAllocationExplainIT method testBetterBalanceButCannotAllocate.

public void testBetterBalanceButCannotAllocate() throws Exception {
    logger.info("--> starting a single node");
    String firstNode = internalCluster().startNode();
    ensureStableCluster(1);
    logger.info("--> creating an index with 5 shards, all allocated to the single node");
    createIndexAndIndexData(5, 0);
    logger.info("--> setting up allocation filtering to only allow allocation to the current node");
    client().admin().indices().prepareUpdateSettings("idx").setSettings(Settings.builder().put("index.routing.allocation.include._name", firstNode)).get();
    logger.info("--> starting another node, with filtering not allowing allocation to the new node, it should not get any shards");
    internalCluster().startNode();
    ensureStableCluster(2);
    boolean includeYesDecisions = randomBoolean();
    boolean includeDiskInfo = randomBoolean();
    ClusterAllocationExplanation explanation = runExplain(true, includeYesDecisions, includeDiskInfo);
    ShardId shardId = explanation.getShard();
    boolean isPrimary = explanation.isPrimary();
    ShardRoutingState shardRoutingState = explanation.getShardState();
    DiscoveryNode currentNode = explanation.getCurrentNode();
    UnassignedInfo unassignedInfo = explanation.getUnassignedInfo();
    ClusterInfo clusterInfo = explanation.getClusterInfo();
    AllocateUnassignedDecision allocateDecision = explanation.getShardAllocationDecision().getAllocateDecision();
    MoveDecision moveDecision = explanation.getShardAllocationDecision().getMoveDecision();
    // verify shard info
    assertEquals("idx", shardId.getIndexName());
    assertEquals(0, shardId.getId());
    assertTrue(isPrimary);
    // verify current node info
    assertEquals(ShardRoutingState.STARTED, shardRoutingState);
    assertNotNull(currentNode);
    // verify unassigned info
    assertNull(unassignedInfo);
    // verify cluster info
    verifyClusterInfo(clusterInfo, includeDiskInfo, 2);
    // verify decision object
    assertFalse(allocateDecision.isDecisionTaken());
    assertTrue(moveDecision.isDecisionTaken());
    assertEquals(AllocationDecision.NO, moveDecision.getAllocationDecision());
    assertEquals("cannot rebalance as no target node exists that can both allocate this shard and improve the cluster balance", moveDecision.getExplanation());
    assertTrue(moveDecision.canRemain());
    assertFalse(moveDecision.forceMove());
    assertTrue(moveDecision.canRebalanceCluster());
    assertNotNull(moveDecision.getCanRemainDecision());
    assertNull(moveDecision.getTargetNode());
    assertEquals(2, moveDecision.getCurrentNodeRanking());
    // verifying cluster rebalance decision object
    assertNotNull(moveDecision.getClusterRebalanceDecision());
    assertEquals(Decision.Type.YES, moveDecision.getClusterRebalanceDecision().type());
    for (Decision d : moveDecision.getClusterRebalanceDecision().getDecisions()) {
        assertEquals(Decision.Type.YES, d.type());
        assertNotNull(d.getExplanation());
    }
    // verify node decisions
    assertEquals(1, moveDecision.getNodeDecisions().size());
    NodeAllocationResult result = moveDecision.getNodeDecisions().get(0);
    assertNotNull(result.getNode());
    assertEquals(1, result.getWeightRanking());
    assertEquals(AllocationDecision.NO, result.getNodeDecision());
    if (includeYesDecisions) {
        assertThat(result.getCanAllocateDecision().getDecisions().size(), greaterThan(1));
    } else {
        assertEquals(1, result.getCanAllocateDecision().getDecisions().size());
    }
    String primaryNodeName = primaryNodeName();
    for (Decision d : result.getCanAllocateDecision().getDecisions()) {
        if (d.label().equals("filter")) {
            assertEquals(Decision.Type.NO, d.type());
            assertEquals("node does not match index setting [index.routing.allocation.include] filters [_name:\"" + primaryNodeName + "\"]", d.getExplanation());
        } else {
            assertEquals(Decision.Type.YES, d.type());
            assertNotNull(d.getExplanation());
        }
    }
    // verify JSON output
    try (XContentParser parser = getParser(explanation)) {
        verifyShardInfo(parser, true, includeDiskInfo, ShardRoutingState.STARTED);
        parser.nextToken();
        assertEquals("can_remain_on_current_node", parser.currentName());
        parser.nextToken();
        assertEquals(AllocationDecision.YES.toString(), parser.text());
        parser.nextToken();
        assertEquals("can_rebalance_cluster", parser.currentName());
        parser.nextToken();
        assertEquals(AllocationDecision.YES.toString(), parser.text());
        parser.nextToken();
        assertEquals("can_rebalance_to_other_node", parser.currentName());
        parser.nextToken();
        assertEquals(AllocationDecision.NO.toString(), parser.text());
        parser.nextToken();
        assertEquals("rebalance_explanation", parser.currentName());
        parser.nextToken();
        assertEquals("cannot rebalance as no target node exists that can both allocate this shard and improve the cluster balance", parser.text());
        verifyNodeDecisions(parser, allNodeDecisions(AllocationDecision.NO, true), includeYesDecisions, false);
        assertEquals(Token.END_OBJECT, parser.nextToken());
    }
}
Also used : DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) UnassignedInfo(org.elasticsearch.cluster.routing.UnassignedInfo) MoveDecision(org.elasticsearch.cluster.routing.allocation.MoveDecision) Matchers.containsString(org.hamcrest.Matchers.containsString) ShardRoutingState(org.elasticsearch.cluster.routing.ShardRoutingState) MoveDecision(org.elasticsearch.cluster.routing.allocation.MoveDecision) AllocationDecision(org.elasticsearch.cluster.routing.allocation.AllocationDecision) AllocateUnassignedDecision(org.elasticsearch.cluster.routing.allocation.AllocateUnassignedDecision) Decision(org.elasticsearch.cluster.routing.allocation.decider.Decision) ShardId(org.elasticsearch.index.shard.ShardId) ClusterInfo(org.elasticsearch.cluster.ClusterInfo) AllocateUnassignedDecision(org.elasticsearch.cluster.routing.allocation.AllocateUnassignedDecision) NodeAllocationResult(org.elasticsearch.cluster.routing.allocation.NodeAllocationResult) XContentParser(org.elasticsearch.common.xcontent.XContentParser)

Aggregations

ShardRoutingState (org.elasticsearch.cluster.routing.ShardRoutingState)17 ShardId (org.elasticsearch.index.shard.ShardId)13 DiscoveryNode (org.elasticsearch.cluster.node.DiscoveryNode)12 UnassignedInfo (org.elasticsearch.cluster.routing.UnassignedInfo)12 AllocateUnassignedDecision (org.elasticsearch.cluster.routing.allocation.AllocateUnassignedDecision)10 MoveDecision (org.elasticsearch.cluster.routing.allocation.MoveDecision)10 XContentParser (org.elasticsearch.common.xcontent.XContentParser)10 ClusterInfo (org.elasticsearch.cluster.ClusterInfo)9 NodeAllocationResult (org.elasticsearch.cluster.routing.allocation.NodeAllocationResult)9 AllocationDecision (org.elasticsearch.cluster.routing.allocation.AllocationDecision)8 Decision (org.elasticsearch.cluster.routing.allocation.decider.Decision)8 ClusterState (org.elasticsearch.cluster.ClusterState)6 Matchers.containsString (org.hamcrest.Matchers.containsString)6 HashMap (java.util.HashMap)4 IndexShardRoutingTable (org.elasticsearch.cluster.routing.IndexShardRoutingTable)4 ShardRouting (org.elasticsearch.cluster.routing.ShardRouting)4 IndexMetaData (org.elasticsearch.cluster.metadata.IndexMetaData)3 HashSet (java.util.HashSet)2 DiscoveryNodes (org.elasticsearch.cluster.node.DiscoveryNodes)2 IndexRoutingTable (org.elasticsearch.cluster.routing.IndexRoutingTable)2