Skip to content

Commit f186c56

Browse files
committed
TieredBalancingWeightsFactory -> StatelessBalancingWeightsFactory
1 parent 3557b54 commit f186c56

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

server/src/main/java/org/elasticsearch/cluster/ClusterModule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
import org.elasticsearch.cluster.routing.allocation.allocator.DesiredBalanceShardsAllocator.DesiredBalanceReconcilerAction;
4545
import org.elasticsearch.cluster.routing.allocation.allocator.GlobalBalancingWeightsFactory;
4646
import org.elasticsearch.cluster.routing.allocation.allocator.ShardsAllocator;
47-
import org.elasticsearch.cluster.routing.allocation.allocator.TieredBalancingWeightsFactory;
47+
import org.elasticsearch.cluster.routing.allocation.allocator.StatelessBalancingWeightsFactory;
4848
import org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider;
4949
import org.elasticsearch.cluster.routing.allocation.decider.AllocationDeciders;
5050
import org.elasticsearch.cluster.routing.allocation.decider.AwarenessAllocationDecider;
@@ -153,7 +153,7 @@ public ClusterModule(
153153
// I'm aware that the following is an anti-pattern and will implement as an SPI provider or plugin
154154
// if we decide to go ahead with this.
155155
final BalancingWeightsFactory balancingWeightsFactory = DiscoveryNode.isStateless(settings)
156-
? new TieredBalancingWeightsFactory(balancerSettings, clusterService.getClusterSettings())
156+
? new StatelessBalancingWeightsFactory(balancerSettings, clusterService.getClusterSettings())
157157
: new GlobalBalancingWeightsFactory(balancerSettings);
158158
var nodeAllocationStatsAndWeightsCalculator = new NodeAllocationStatsAndWeightsCalculator(
159159
writeLoadForecaster,

server/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator/TieredBalancingWeightsFactory.java renamed to server/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator/StatelessBalancingWeightsFactory.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import static org.elasticsearch.cluster.routing.allocation.allocator.BalancedShardsAllocator.SHARD_BALANCE_FACTOR_SETTING;
2525
import static org.elasticsearch.cluster.routing.allocation.allocator.BalancedShardsAllocator.WRITE_LOAD_BALANCE_FACTOR_SETTING;
2626

27-
public class TieredBalancingWeightsFactory implements BalancingWeightsFactory {
27+
public class StatelessBalancingWeightsFactory implements BalancingWeightsFactory {
2828

2929
public static final Setting<Float> INDEXING_TIER_SHARD_BALANCE_FACTOR_SETTING = Setting.floatSetting(
3030
"cluster.routing.allocation.balance.shard.indexing",
@@ -55,7 +55,7 @@ public class TieredBalancingWeightsFactory implements BalancingWeightsFactory {
5555
private volatile float searchTierShardBalanceFactor;
5656
private volatile float indexingTierWriteLoadBalanceFactor;
5757

58-
public TieredBalancingWeightsFactory(BalancerSettings balancerSettings, ClusterSettings clusterSettings) {
58+
public StatelessBalancingWeightsFactory(BalancerSettings balancerSettings, ClusterSettings clusterSettings) {
5959
this.balancerSettings = balancerSettings;
6060
clusterSettings.initializeAndWatch(
6161
INDEXING_TIER_SHARD_BALANCE_FACTOR_SETTING,
@@ -70,15 +70,15 @@ public TieredBalancingWeightsFactory(BalancerSettings balancerSettings, ClusterS
7070

7171
@Override
7272
public BalancingWeights create() {
73-
return new TieredBalancingWeights();
73+
return new StatelessBalancingWeights();
7474
}
7575

76-
private class TieredBalancingWeights implements BalancingWeights {
76+
private class StatelessBalancingWeights implements BalancingWeights {
7777

7878
private final WeightFunction searchWeightFunction;
7979
private final WeightFunction indexingWeightFunction;
8080

81-
private TieredBalancingWeights() {
81+
private StatelessBalancingWeights() {
8282
this.searchWeightFunction = new WeightFunction(
8383
searchTierShardBalanceFactor,
8484
balancerSettings.getIndexBalanceFactor(),

server/src/main/java/org/elasticsearch/common/settings/ClusterSettings.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
import org.elasticsearch.cluster.routing.allocation.allocator.BalancedShardsAllocator;
5252
import org.elasticsearch.cluster.routing.allocation.allocator.DesiredBalanceComputer;
5353
import org.elasticsearch.cluster.routing.allocation.allocator.DesiredBalanceReconciler;
54-
import org.elasticsearch.cluster.routing.allocation.allocator.TieredBalancingWeightsFactory;
54+
import org.elasticsearch.cluster.routing.allocation.allocator.StatelessBalancingWeightsFactory;
5555
import org.elasticsearch.cluster.routing.allocation.decider.AwarenessAllocationDecider;
5656
import org.elasticsearch.cluster.routing.allocation.decider.ClusterRebalanceAllocationDecider;
5757
import org.elasticsearch.cluster.routing.allocation.decider.ConcurrentRebalanceAllocationDecider;
@@ -226,9 +226,9 @@ public void apply(Settings value, Settings current, Settings previous) {
226226
BalancedShardsAllocator.WRITE_LOAD_BALANCE_FACTOR_SETTING,
227227
BalancedShardsAllocator.DISK_USAGE_BALANCE_FACTOR_SETTING,
228228
BalancedShardsAllocator.THRESHOLD_SETTING,
229-
TieredBalancingWeightsFactory.INDEXING_TIER_SHARD_BALANCE_FACTOR_SETTING,
230-
TieredBalancingWeightsFactory.SEARCH_TIER_SHARD_BALANCE_FACTOR_SETTING,
231-
TieredBalancingWeightsFactory.INDEXING_TIER_WRITE_LOAD_BALANCE_FACTOR_SETTING,
229+
StatelessBalancingWeightsFactory.INDEXING_TIER_SHARD_BALANCE_FACTOR_SETTING,
230+
StatelessBalancingWeightsFactory.SEARCH_TIER_SHARD_BALANCE_FACTOR_SETTING,
231+
StatelessBalancingWeightsFactory.INDEXING_TIER_WRITE_LOAD_BALANCE_FACTOR_SETTING,
232232
DataStreamAutoShardingService.DATA_STREAMS_AUTO_SHARDING_DECREASE_SHARDS_COOLDOWN,
233233
DataStreamAutoShardingService.DATA_STREAMS_AUTO_SHARDING_INCREASE_SHARDS_COOLDOWN,
234234
DataStreamAutoShardingService.DATA_STREAMS_AUTO_SHARDING_EXCLUDES_SETTING,

0 commit comments

Comments
 (0)