public abstract class PrimaryShardAllocator extends AbstractComponent
BalancedShardsAllocator
),
nor does it allocate primaries when a primary shard failed and there is a valid replica
copy that can immediately be promoted to primary, as this takes place in RoutingNodes.failShard(org.apache.logging.log4j.Logger, org.elasticsearch.cluster.routing.ShardRouting, org.elasticsearch.cluster.routing.UnassignedInfo, org.elasticsearch.cluster.metadata.IndexMetaData, org.elasticsearch.cluster.routing.RoutingChangesObserver)
.Modifier and Type | Field and Description |
---|---|
static Setting<java.lang.String> |
INDEX_RECOVERY_INITIAL_SHARDS_SETTING
Deprecated.
|
static Setting<java.lang.String> |
NODE_INITIAL_SHARDS_SETTING |
deprecationLogger, logger, settings
Constructor and Description |
---|
PrimaryShardAllocator(Settings settings) |
Modifier and Type | Method and Description |
---|---|
void |
allocateUnassigned(RoutingAllocation allocation) |
protected org.elasticsearch.gateway.PrimaryShardAllocator.NodeShardsResult |
buildAllocationIdBasedNodeShardsResult(ShardRouting shard,
boolean matchAnyShard,
java.util.Set<java.lang.String> ignoreNodes,
java.util.Set<java.lang.String> inSyncAllocationIds,
AsyncShardFetch.FetchResult<TransportNodesListGatewayStartedShards.NodeGatewayStartedShards> shardState)
Builds a list of nodes.
|
protected abstract AsyncShardFetch.FetchResult<TransportNodesListGatewayStartedShards.NodeGatewayStartedShards> |
fetchData(ShardRouting shard,
RoutingAllocation allocation) |
logDeprecatedSetting, logRemovedSetting, nodeName
public static final Setting<java.lang.String> NODE_INITIAL_SHARDS_SETTING
@Deprecated public static final Setting<java.lang.String> INDEX_RECOVERY_INITIAL_SHARDS_SETTING
public PrimaryShardAllocator(Settings settings)
public void allocateUnassigned(RoutingAllocation allocation)
protected org.elasticsearch.gateway.PrimaryShardAllocator.NodeShardsResult buildAllocationIdBasedNodeShardsResult(ShardRouting shard, boolean matchAnyShard, java.util.Set<java.lang.String> ignoreNodes, java.util.Set<java.lang.String> inSyncAllocationIds, AsyncShardFetch.FetchResult<TransportNodesListGatewayStartedShards.NodeGatewayStartedShards> shardState)
protected abstract AsyncShardFetch.FetchResult<TransportNodesListGatewayStartedShards.NodeGatewayStartedShards> fetchData(ShardRouting shard, RoutingAllocation allocation)