Search in sources :

Example 1 with ShardsAllocator

use of org.opensearch.cluster.routing.allocation.allocator.ShardsAllocator in project OpenSearch by opensearch-project.

the class BalanceConfigurationTests method testNoRebalanceOnPrimaryOverload.

public void testNoRebalanceOnPrimaryOverload() {
    Settings.Builder settings = Settings.builder();
    AllocationService strategy = new AllocationService(randomAllocationDeciders(settings.build(), new ClusterSettings(Settings.Builder.EMPTY_SETTINGS, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS), random()), new TestGatewayAllocator(), new ShardsAllocator() {

        /*
                 *  // this allocator tries to rebuild this scenario where a rebalance is
                 *  // triggered solely by the primary overload on node [1] where a shard
                 *  // is rebalanced to node 0
                    routing_nodes:
                    -----node_id[0][V]
                    --------[test][0], node[0], [R], s[STARTED]
                    --------[test][4], node[0], [R], s[STARTED]
                    -----node_id[1][V]
                    --------[test][0], node[1], [P], s[STARTED]
                    --------[test][1], node[1], [P], s[STARTED]
                    --------[test][3], node[1], [R], s[STARTED]
                    -----node_id[2][V]
                    --------[test][1], node[2], [R], s[STARTED]
                    --------[test][2], node[2], [R], s[STARTED]
                    --------[test][4], node[2], [P], s[STARTED]
                    -----node_id[3][V]
                    --------[test][2], node[3], [P], s[STARTED]
                    --------[test][3], node[3], [P], s[STARTED]
                    ---- unassigned
                */
        public void allocate(RoutingAllocation allocation) {
            RoutingNodes.UnassignedShards unassigned = allocation.routingNodes().unassigned();
            ShardRouting[] drain = unassigned.drain();
            // we have to allocate primaries first
            ArrayUtil.timSort(drain, (a, b) -> {
                return a.primary() ? -1 : 1;
            });
            for (ShardRouting sr : drain) {
                switch(sr.id()) {
                    case 0:
                        if (sr.primary()) {
                            allocation.routingNodes().initializeShard(sr, "node1", null, -1, allocation.changes());
                        } else {
                            allocation.routingNodes().initializeShard(sr, "node0", null, -1, allocation.changes());
                        }
                        break;
                    case 1:
                        if (sr.primary()) {
                            allocation.routingNodes().initializeShard(sr, "node1", null, -1, allocation.changes());
                        } else {
                            allocation.routingNodes().initializeShard(sr, "node2", null, -1, allocation.changes());
                        }
                        break;
                    case 2:
                        if (sr.primary()) {
                            allocation.routingNodes().initializeShard(sr, "node3", null, -1, allocation.changes());
                        } else {
                            allocation.routingNodes().initializeShard(sr, "node2", null, -1, allocation.changes());
                        }
                        break;
                    case 3:
                        if (sr.primary()) {
                            allocation.routingNodes().initializeShard(sr, "node3", null, -1, allocation.changes());
                        } else {
                            allocation.routingNodes().initializeShard(sr, "node1", null, -1, allocation.changes());
                        }
                        break;
                    case 4:
                        if (sr.primary()) {
                            allocation.routingNodes().initializeShard(sr, "node2", null, -1, allocation.changes());
                        } else {
                            allocation.routingNodes().initializeShard(sr, "node0", null, -1, allocation.changes());
                        }
                        break;
                }
            }
        }

        @Override
        public ShardAllocationDecision decideShardAllocation(ShardRouting shard, RoutingAllocation allocation) {
            throw new UnsupportedOperationException("explain not supported");
        }
    }, EmptyClusterInfoService.INSTANCE, EmptySnapshotsInfoService.INSTANCE);
    Metadata.Builder metadataBuilder = Metadata.builder();
    RoutingTable.Builder routingTableBuilder = RoutingTable.builder();
    IndexMetadata.Builder indexMeta = IndexMetadata.builder("test").settings(settings(Version.CURRENT)).numberOfShards(5).numberOfReplicas(1);
    metadataBuilder = metadataBuilder.put(indexMeta);
    Metadata metadata = metadataBuilder.build();
    for (ObjectCursor<IndexMetadata> cursor : metadata.indices().values()) {
        routingTableBuilder.addAsNew(cursor.value);
    }
    RoutingTable routingTable = routingTableBuilder.build();
    DiscoveryNodes.Builder nodes = DiscoveryNodes.builder();
    for (int i = 0; i < 4; i++) {
        DiscoveryNode node = newNode("node" + i);
        nodes.add(node);
    }
    ClusterState clusterState = ClusterState.builder(org.opensearch.cluster.ClusterName.CLUSTER_NAME_SETTING.getDefault(Settings.EMPTY)).nodes(nodes).metadata(metadata).routingTable(routingTable).build();
    routingTable = strategy.reroute(clusterState, "reroute").routingTable();
    clusterState = ClusterState.builder(clusterState).routingTable(routingTable).build();
    RoutingNodes routingNodes = clusterState.getRoutingNodes();
    for (RoutingNode routingNode : routingNodes) {
        for (ShardRouting shardRouting : routingNode) {
            assertThat(shardRouting.state(), Matchers.equalTo(ShardRoutingState.INITIALIZING));
        }
    }
    strategy = createAllocationService(settings.build(), new TestGatewayAllocator());
    logger.info("use the new allocator and check if it moves shards");
    routingTable = startInitializingShardsAndReroute(strategy, clusterState).routingTable();
    clusterState = ClusterState.builder(clusterState).routingTable(routingTable).build();
    routingNodes = clusterState.getRoutingNodes();
    for (RoutingNode routingNode : routingNodes) {
        for (ShardRouting shardRouting : routingNode) {
            assertThat(shardRouting.state(), Matchers.equalTo(ShardRoutingState.STARTED));
        }
    }
    logger.info("start the replica shards");
    routingTable = startInitializingShardsAndReroute(strategy, clusterState).routingTable();
    clusterState = ClusterState.builder(clusterState).routingTable(routingTable).build();
    routingNodes = clusterState.getRoutingNodes();
    for (RoutingNode routingNode : routingNodes) {
        for (ShardRouting shardRouting : routingNode) {
            assertThat(shardRouting.state(), Matchers.equalTo(ShardRoutingState.STARTED));
        }
    }
    logger.info("rebalancing");
    routingTable = strategy.reroute(clusterState, "reroute").routingTable();
    clusterState = ClusterState.builder(clusterState).routingTable(routingTable).build();
    routingNodes = clusterState.getRoutingNodes();
    for (RoutingNode routingNode : routingNodes) {
        for (ShardRouting shardRouting : routingNode) {
            assertThat(shardRouting.state(), Matchers.equalTo(ShardRoutingState.STARTED));
        }
    }
}
Also used : DiscoveryNodes(org.opensearch.cluster.node.DiscoveryNodes) Metadata(org.opensearch.cluster.metadata.Metadata) IndexMetadata(org.opensearch.cluster.metadata.IndexMetadata) ClusterRebalanceAllocationDecider(org.opensearch.cluster.routing.allocation.decider.ClusterRebalanceAllocationDecider) Version(org.opensearch.Version) ClusterState(org.opensearch.cluster.ClusterState) DiscoveryNode(org.opensearch.cluster.node.DiscoveryNode) STARTED(org.opensearch.cluster.routing.ShardRoutingState.STARTED) OpenSearchAllocationTestCase(org.opensearch.cluster.OpenSearchAllocationTestCase) RoutingNodes(org.opensearch.cluster.routing.RoutingNodes) ShardRoutingState(org.opensearch.cluster.routing.ShardRoutingState) BalancedShardsAllocator(org.opensearch.cluster.routing.allocation.allocator.BalancedShardsAllocator) ClusterSettings(org.opensearch.common.settings.ClusterSettings) ShardsAllocator(org.opensearch.cluster.routing.allocation.allocator.ShardsAllocator) TestGatewayAllocator(org.opensearch.test.gateway.TestGatewayAllocator) ArrayUtil(org.apache.lucene.util.ArrayUtil) Matchers(org.hamcrest.Matchers) Settings(org.opensearch.common.settings.Settings) ObjectCursor(com.carrotsearch.hppc.cursors.ObjectCursor) Collectors(java.util.stream.Collectors) ShardRouting(org.opensearch.cluster.routing.ShardRouting) Logger(org.apache.logging.log4j.Logger) EmptySnapshotsInfoService(org.opensearch.snapshots.EmptySnapshotsInfoService) UNASSIGNED(org.opensearch.cluster.routing.ShardRoutingState.UNASSIGNED) EmptyClusterInfoService(org.opensearch.cluster.EmptyClusterInfoService) RoutingTable(org.opensearch.cluster.routing.RoutingTable) RoutingNode(org.opensearch.cluster.routing.RoutingNode) LogManager(org.apache.logging.log4j.LogManager) DiscoveryNode(org.opensearch.cluster.node.DiscoveryNode) ClusterSettings(org.opensearch.common.settings.ClusterSettings) RoutingNodes(org.opensearch.cluster.routing.RoutingNodes) Metadata(org.opensearch.cluster.metadata.Metadata) IndexMetadata(org.opensearch.cluster.metadata.IndexMetadata) BalancedShardsAllocator(org.opensearch.cluster.routing.allocation.allocator.BalancedShardsAllocator) ShardsAllocator(org.opensearch.cluster.routing.allocation.allocator.ShardsAllocator) RoutingNode(org.opensearch.cluster.routing.RoutingNode) IndexMetadata(org.opensearch.cluster.metadata.IndexMetadata) ClusterSettings(org.opensearch.common.settings.ClusterSettings) Settings(org.opensearch.common.settings.Settings) DiscoveryNodes(org.opensearch.cluster.node.DiscoveryNodes) TestGatewayAllocator(org.opensearch.test.gateway.TestGatewayAllocator) ClusterState(org.opensearch.cluster.ClusterState) RoutingTable(org.opensearch.cluster.routing.RoutingTable) ShardRouting(org.opensearch.cluster.routing.ShardRouting)

Example 2 with ShardsAllocator

use of org.opensearch.cluster.routing.allocation.allocator.ShardsAllocator in project OpenSearch by opensearch-project.

the class ClusterAllocationExplainActionTests method testInitializingOrRelocatingShardExplanation.

public void testInitializingOrRelocatingShardExplanation() throws Exception {
    ShardRoutingState shardRoutingState = randomFrom(ShardRoutingState.INITIALIZING, ShardRoutingState.RELOCATING);
    ClusterState clusterState = ClusterStateCreationUtils.state("idx", randomBoolean(), shardRoutingState);
    ShardRouting shard = clusterState.getRoutingTable().index("idx").shard(0).primaryShard();
    RoutingAllocation allocation = new RoutingAllocation(new AllocationDeciders(Collections.emptyList()), clusterState.getRoutingNodes(), clusterState, null, null, System.nanoTime());
    ClusterAllocationExplanation cae = TransportClusterAllocationExplainAction.explainShard(shard, allocation, null, randomBoolean(), new AllocationService(null, new TestGatewayAllocator(), new ShardsAllocator() {

        @Override
        public void allocate(RoutingAllocation allocation) {
        // no-op
        }

        @Override
        public ShardAllocationDecision decideShardAllocation(ShardRouting shard, RoutingAllocation allocation) {
            if (shard.initializing() || shard.relocating()) {
                return ShardAllocationDecision.NOT_TAKEN;
            } else {
                throw new UnsupportedOperationException("cannot explain");
            }
        }
    }, null, null));
    assertEquals(shard.currentNodeId(), cae.getCurrentNode().getId());
    assertFalse(cae.getShardAllocationDecision().isDecisionTaken());
    assertFalse(cae.getShardAllocationDecision().getAllocateDecision().isDecisionTaken());
    assertFalse(cae.getShardAllocationDecision().getMoveDecision().isDecisionTaken());
    XContentBuilder builder = XContentFactory.jsonBuilder();
    cae.toXContent(builder, ToXContent.EMPTY_PARAMS);
    String explanation;
    if (shardRoutingState == ShardRoutingState.RELOCATING) {
        explanation = "the shard is in the process of relocating from node [] to node [], wait until " + "relocation has completed";
    } else {
        explanation = "the shard is in the process of initializing on node [], " + "wait until initialization has completed";
    }
    assertEquals("{\"index\":\"idx\",\"shard\":0,\"primary\":true,\"current_state\":\"" + shardRoutingState.toString().toLowerCase(Locale.ROOT) + "\"" + (shard.unassignedInfo() != null ? ",\"unassigned_info\":{" + "\"reason\":\"" + shard.unassignedInfo().getReason() + "\"," + "\"at\":\"" + UnassignedInfo.DATE_TIME_FORMATTER.format(Instant.ofEpochMilli(shard.unassignedInfo().getUnassignedTimeInMillis())) + "\"," + "\"last_allocation_status\":\"" + AllocationDecision.fromAllocationStatus(shard.unassignedInfo().getLastAllocationStatus()) + "\"}" : "") + ",\"current_node\":" + "{\"id\":\"" + cae.getCurrentNode().getId() + "\",\"name\":\"" + cae.getCurrentNode().getName() + "\",\"transport_address\":\"" + cae.getCurrentNode().getAddress() + "\"},\"explanation\":\"" + explanation + "\"}", Strings.toString(builder));
}
Also used : TestGatewayAllocator(org.opensearch.test.gateway.TestGatewayAllocator) ClusterState(org.opensearch.cluster.ClusterState) ShardRoutingState(org.opensearch.cluster.routing.ShardRoutingState) AllocationDeciders(org.opensearch.cluster.routing.allocation.decider.AllocationDeciders) ShardsAllocator(org.opensearch.cluster.routing.allocation.allocator.ShardsAllocator) ShardRouting(org.opensearch.cluster.routing.ShardRouting) RoutingAllocation(org.opensearch.cluster.routing.allocation.RoutingAllocation) AllocationService(org.opensearch.cluster.routing.allocation.AllocationService) XContentBuilder(org.opensearch.common.xcontent.XContentBuilder)

Example 3 with ShardsAllocator

use of org.opensearch.cluster.routing.allocation.allocator.ShardsAllocator in project OpenSearch by opensearch-project.

the class ClusterModule method createShardsAllocator.

private static ShardsAllocator createShardsAllocator(Settings settings, ClusterSettings clusterSettings, List<ClusterPlugin> clusterPlugins) {
    Map<String, Supplier<ShardsAllocator>> allocators = new HashMap<>();
    allocators.put(BALANCED_ALLOCATOR, () -> new BalancedShardsAllocator(settings, clusterSettings));
    for (ClusterPlugin plugin : clusterPlugins) {
        plugin.getShardsAllocators(settings, clusterSettings).forEach((k, v) -> {
            if (allocators.put(k, v) != null) {
                throw new IllegalArgumentException("ShardsAllocator [" + k + "] already defined");
            }
        });
    }
    String allocatorName = SHARDS_ALLOCATOR_TYPE_SETTING.get(settings);
    Supplier<ShardsAllocator> allocatorSupplier = allocators.get(allocatorName);
    if (allocatorSupplier == null) {
        throw new IllegalArgumentException("Unknown ShardsAllocator [" + allocatorName + "]");
    }
    return Objects.requireNonNull(allocatorSupplier.get(), "ShardsAllocator factory for [" + allocatorName + "] returned null");
}
Also used : HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) BalancedShardsAllocator(org.opensearch.cluster.routing.allocation.allocator.BalancedShardsAllocator) ClusterPlugin(org.opensearch.plugins.ClusterPlugin) Supplier(java.util.function.Supplier) BalancedShardsAllocator(org.opensearch.cluster.routing.allocation.allocator.BalancedShardsAllocator) ShardsAllocator(org.opensearch.cluster.routing.allocation.allocator.ShardsAllocator) ExistingShardsAllocator(org.opensearch.cluster.routing.allocation.ExistingShardsAllocator)

Example 4 with ShardsAllocator

use of org.opensearch.cluster.routing.allocation.allocator.ShardsAllocator in project OpenSearch by opensearch-project.

the class AllocationServiceTests method testAssignsPrimariesInPriorityOrderThenReplicas.

public void testAssignsPrimariesInPriorityOrderThenReplicas() {
    // throttle (incoming) recoveries in order to observe the order of operations, but do not throttle outgoing recoveries since
    // the effects of that depend on the earlier (random) allocations
    final Settings settings = Settings.builder().put(CLUSTER_ROUTING_ALLOCATION_NODE_INITIAL_PRIMARIES_RECOVERIES_SETTING.getKey(), 1).put(CLUSTER_ROUTING_ALLOCATION_NODE_INITIAL_REPLICAS_RECOVERIES_SETTING.getKey(), 1).put(CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_INCOMING_RECOVERIES_SETTING.getKey(), 1).put(CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_OUTGOING_RECOVERIES_SETTING.getKey(), Integer.MAX_VALUE).build();
    final ClusterSettings clusterSettings = new ClusterSettings(settings, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS);
    final AllocationService allocationService = new AllocationService(new AllocationDeciders(Arrays.asList(new SameShardAllocationDecider(settings, clusterSettings), new ThrottlingAllocationDecider(settings, clusterSettings))), new ShardsAllocator() {

        @Override
        public void allocate(RoutingAllocation allocation) {
            // all primaries are handled by existing shards allocators in these tests; even the invalid allocator prevents shards
            // from falling through to here
            assertThat(allocation.routingNodes().unassigned().getNumPrimaries(), equalTo(0));
        }

        @Override
        public ShardAllocationDecision decideShardAllocation(ShardRouting shard, RoutingAllocation allocation) {
            return ShardAllocationDecision.NOT_TAKEN;
        }
    }, new EmptyClusterInfoService(), EmptySnapshotsInfoService.INSTANCE);
    final String unrealisticAllocatorName = "unrealistic";
    final Map<String, ExistingShardsAllocator> allocatorMap = new HashMap<>();
    final TestGatewayAllocator testGatewayAllocator = new TestGatewayAllocator();
    allocatorMap.put(GatewayAllocator.ALLOCATOR_NAME, testGatewayAllocator);
    allocatorMap.put(unrealisticAllocatorName, new UnrealisticAllocator());
    allocationService.setExistingShardsAllocators(allocatorMap);
    final DiscoveryNodes.Builder nodesBuilder = DiscoveryNodes.builder();
    nodesBuilder.add(new DiscoveryNode("node1", buildNewFakeTransportAddress(), Version.CURRENT));
    nodesBuilder.add(new DiscoveryNode("node2", buildNewFakeTransportAddress(), Version.CURRENT));
    nodesBuilder.add(new DiscoveryNode("node3", buildNewFakeTransportAddress(), Version.CURRENT));
    final Metadata.Builder metadata = Metadata.builder().put(indexMetadata("highPriority", Settings.builder().put(IndexMetadata.SETTING_PRIORITY, 10))).put(indexMetadata("mediumPriority", Settings.builder().put(IndexMetadata.SETTING_PRIORITY, 5).put(ExistingShardsAllocator.EXISTING_SHARDS_ALLOCATOR_SETTING.getKey(), unrealisticAllocatorName))).put(indexMetadata("lowPriority", Settings.builder().put(IndexMetadata.SETTING_PRIORITY, 3))).put(indexMetadata("invalid", Settings.builder().put(IndexMetadata.SETTING_PRIORITY, between(0, 15)).put(ExistingShardsAllocator.EXISTING_SHARDS_ALLOCATOR_SETTING.getKey(), "unknown")));
    final RoutingTable.Builder routingTableBuilder = RoutingTable.builder().addAsRecovery(metadata.get("highPriority")).addAsRecovery(metadata.get("mediumPriority")).addAsRecovery(metadata.get("lowPriority")).addAsRecovery(metadata.get("invalid"));
    final ClusterState clusterState = ClusterState.builder(ClusterName.DEFAULT).nodes(nodesBuilder).metadata(metadata).routingTable(routingTableBuilder.build()).build();
    // permit the testGatewayAllocator to allocate primaries to every node
    for (IndexRoutingTable indexRoutingTable : clusterState.routingTable()) {
        for (IndexShardRoutingTable indexShardRoutingTable : indexRoutingTable) {
            final ShardRouting primaryShard = indexShardRoutingTable.primaryShard();
            for (DiscoveryNode node : clusterState.nodes()) {
                testGatewayAllocator.addKnownAllocation(primaryShard.initialize(node.getId(), FAKE_IN_SYNC_ALLOCATION_ID, 0L));
            }
        }
    }
    final ClusterState reroutedState1 = rerouteAndStartShards(allocationService, clusterState);
    final RoutingTable routingTable1 = reroutedState1.routingTable();
    // the test harness only permits one recovery per node, so we must have allocated all the high-priority primaries and one of the
    // medium-priority ones
    assertThat(routingTable1.shardsWithState(ShardRoutingState.INITIALIZING), empty());
    assertThat(routingTable1.shardsWithState(ShardRoutingState.RELOCATING), empty());
    assertTrue(routingTable1.shardsWithState(ShardRoutingState.STARTED).stream().allMatch(ShardRouting::primary));
    assertThat(routingTable1.index("highPriority").primaryShardsActive(), equalTo(2));
    assertThat(routingTable1.index("mediumPriority").primaryShardsActive(), equalTo(1));
    assertThat(routingTable1.index("lowPriority").shardsWithState(ShardRoutingState.STARTED), empty());
    assertThat(routingTable1.index("invalid").shardsWithState(ShardRoutingState.STARTED), empty());
    final ClusterState reroutedState2 = rerouteAndStartShards(allocationService, reroutedState1);
    final RoutingTable routingTable2 = reroutedState2.routingTable();
    // this reroute starts the one remaining medium-priority primary and both of the low-priority ones,
    // and also 1 medium priority replica
    assertThat(routingTable2.shardsWithState(ShardRoutingState.INITIALIZING), empty());
    assertThat(routingTable2.shardsWithState(ShardRoutingState.RELOCATING), empty());
    assertTrue(routingTable2.index("highPriority").allPrimaryShardsActive());
    assertTrue(routingTable2.index("mediumPriority").allPrimaryShardsActive());
    assertThat(routingTable2.index("mediumPriority").shardsWithState(ShardRoutingState.STARTED).size(), equalTo(3));
    assertThat(routingTable2.index("mediumPriority").shardsWithState(ShardRoutingState.UNASSIGNED).size(), equalTo(1));
    assertTrue(routingTable2.index("lowPriority").allPrimaryShardsActive());
    assertThat(routingTable2.index("invalid").shardsWithState(ShardRoutingState.STARTED), empty());
    final ClusterState reroutedState3 = rerouteAndStartShards(allocationService, reroutedState2);
    final RoutingTable routingTable3 = reroutedState3.routingTable();
    // this reroute starts the one remaining medium-priority replica
    assertThat(routingTable3.shardsWithState(ShardRoutingState.INITIALIZING), empty());
    assertThat(routingTable3.shardsWithState(ShardRoutingState.RELOCATING), empty());
    assertTrue(routingTable3.index("highPriority").allPrimaryShardsActive());
    assertTrue(routingTable3.index("mediumPriority").allPrimaryShardsActive());
    assertThat(routingTable3.index("mediumPriority").shardsWithState(ShardRoutingState.UNASSIGNED), empty());
    assertThat(routingTable3.index("mediumPriority").shardsWithState(ShardRoutingState.STARTED).size(), equalTo(4));
    assertTrue(routingTable3.index("lowPriority").allPrimaryShardsActive());
    assertThat(routingTable3.index("invalid").shardsWithState(ShardRoutingState.STARTED), empty());
}
Also used : IndexRoutingTable(org.opensearch.cluster.routing.IndexRoutingTable) IndexShardRoutingTable(org.opensearch.cluster.routing.IndexShardRoutingTable) DiscoveryNode(org.opensearch.cluster.node.DiscoveryNode) ClusterSettings(org.opensearch.common.settings.ClusterSettings) EmptyClusterInfoService(org.opensearch.cluster.EmptyClusterInfoService) HashMap(java.util.HashMap) Metadata(org.opensearch.cluster.metadata.Metadata) IndexMetadata(org.opensearch.cluster.metadata.IndexMetadata) ShardsAllocator(org.opensearch.cluster.routing.allocation.allocator.ShardsAllocator) Matchers.containsString(org.hamcrest.Matchers.containsString) SameShardAllocationDecider(org.opensearch.cluster.routing.allocation.decider.SameShardAllocationDecider) ClusterSettings(org.opensearch.common.settings.ClusterSettings) Settings(org.opensearch.common.settings.Settings) DiscoveryNodes(org.opensearch.cluster.node.DiscoveryNodes) TestGatewayAllocator(org.opensearch.test.gateway.TestGatewayAllocator) ClusterState(org.opensearch.cluster.ClusterState) ThrottlingAllocationDecider(org.opensearch.cluster.routing.allocation.decider.ThrottlingAllocationDecider) AllocationDeciders(org.opensearch.cluster.routing.allocation.decider.AllocationDeciders) IndexRoutingTable(org.opensearch.cluster.routing.IndexRoutingTable) IndexShardRoutingTable(org.opensearch.cluster.routing.IndexShardRoutingTable) RoutingTable(org.opensearch.cluster.routing.RoutingTable) ShardRouting(org.opensearch.cluster.routing.ShardRouting)

Aggregations

ShardsAllocator (org.opensearch.cluster.routing.allocation.allocator.ShardsAllocator)4 ClusterState (org.opensearch.cluster.ClusterState)3 ShardRouting (org.opensearch.cluster.routing.ShardRouting)3 TestGatewayAllocator (org.opensearch.test.gateway.TestGatewayAllocator)3 HashMap (java.util.HashMap)2 EmptyClusterInfoService (org.opensearch.cluster.EmptyClusterInfoService)2 IndexMetadata (org.opensearch.cluster.metadata.IndexMetadata)2 Metadata (org.opensearch.cluster.metadata.Metadata)2 DiscoveryNode (org.opensearch.cluster.node.DiscoveryNode)2 DiscoveryNodes (org.opensearch.cluster.node.DiscoveryNodes)2 RoutingTable (org.opensearch.cluster.routing.RoutingTable)2 ShardRoutingState (org.opensearch.cluster.routing.ShardRoutingState)2 BalancedShardsAllocator (org.opensearch.cluster.routing.allocation.allocator.BalancedShardsAllocator)2 AllocationDeciders (org.opensearch.cluster.routing.allocation.decider.AllocationDeciders)2 ClusterSettings (org.opensearch.common.settings.ClusterSettings)2 Settings (org.opensearch.common.settings.Settings)2 ObjectCursor (com.carrotsearch.hppc.cursors.ObjectCursor)1 LinkedHashMap (java.util.LinkedHashMap)1 Supplier (java.util.function.Supplier)1 Collectors (java.util.stream.Collectors)1