Skip to content

Commit

Permalink
Remove unused routing allocation from disk threshold decider. (#87745)
Browse files Browse the repository at this point in the history
Remove unused routing allocation from disk threshold decider.
  • Loading branch information
howardhuanghua authored Jun 20, 2022
1 parent 26019f2 commit 93bf468
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public static long sizeOfRelocatingShards(
@Override
public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) {
Map<String, DiskUsage> usages = allocation.clusterInfo().getNodeMostAvailableDiskUsages();
final Decision decision = earlyTerminate(allocation, usages);
final Decision decision = earlyTerminate(usages);
if (decision != null) {
return decision;
}
Expand Down Expand Up @@ -420,7 +420,7 @@ public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, Routing
@Override
public Decision canForceAllocateDuringReplace(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) {
Map<String, DiskUsage> usages = allocation.clusterInfo().getNodeMostAvailableDiskUsages();
final Decision decision = earlyTerminate(allocation, usages);
final Decision decision = earlyTerminate(usages);
if (decision != null) {
return decision;
}
Expand Down Expand Up @@ -467,7 +467,7 @@ public Decision canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAl
}
final ClusterInfo clusterInfo = allocation.clusterInfo();
final Map<String, DiskUsage> usages = clusterInfo.getNodeLeastAvailableDiskUsages();
final Decision decision = earlyTerminate(allocation, usages);
final Decision decision = earlyTerminate(usages);
if (decision != null) {
return decision;
}
Expand Down Expand Up @@ -641,7 +641,7 @@ static double freeDiskPercentageAfterShardAssigned(DiskUsageWithRelocations usag

private static final Decision YES_USAGES_UNAVAILABLE = Decision.single(Decision.Type.YES, NAME, "disk usages are unavailable");

private Decision earlyTerminate(RoutingAllocation allocation, Map<String, DiskUsage> usages) {
private Decision earlyTerminate(Map<String, DiskUsage> usages) {
// Always allow allocation if the decider is disabled
if (diskThresholdSettings.isEnabled() == false) {
return YES_DISABLED;
Expand Down

0 comments on commit 93bf468

Please sign in to comment.