From 93bf4680ae31ae97d003408370ccacfd57e9bafb Mon Sep 17 00:00:00 2001 From: Howard Date: Mon, 20 Jun 2022 19:55:49 +0800 Subject: [PATCH] Remove unused routing allocation from disk threshold decider. (#87745) Remove unused routing allocation from disk threshold decider. --- .../routing/allocation/decider/DiskThresholdDecider.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDecider.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDecider.java index 90376c3593169..6917b9d9b7b18 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDecider.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDecider.java @@ -174,7 +174,7 @@ public static long sizeOfRelocatingShards( @Override public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) { Map usages = allocation.clusterInfo().getNodeMostAvailableDiskUsages(); - final Decision decision = earlyTerminate(allocation, usages); + final Decision decision = earlyTerminate(usages); if (decision != null) { return decision; } @@ -420,7 +420,7 @@ public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, Routing @Override public Decision canForceAllocateDuringReplace(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) { Map usages = allocation.clusterInfo().getNodeMostAvailableDiskUsages(); - final Decision decision = earlyTerminate(allocation, usages); + final Decision decision = earlyTerminate(usages); if (decision != null) { return decision; } @@ -467,7 +467,7 @@ public Decision canRemain(ShardRouting shardRouting, RoutingNode node, RoutingAl } final ClusterInfo clusterInfo = allocation.clusterInfo(); final Map usages = clusterInfo.getNodeLeastAvailableDiskUsages(); - final Decision decision = earlyTerminate(allocation, usages); + final Decision decision = earlyTerminate(usages); if (decision != null) { return decision; } @@ -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 usages) { + private Decision earlyTerminate(Map usages) { // Always allow allocation if the decider is disabled if (diskThresholdSettings.isEnabled() == false) { return YES_DISABLED;