Skip to content

Commit bccf030

Browse files
kelywelsch
authored andcommitted
Fix cluster.routing.allocation.enable and cluster.routing.rebalance.enable casing (#28037)
Fixes the default value of cluster.routing.allocation.enable and cluster.routing.rebalance.enable to be lower-case.
1 parent 29b07bb commit bccf030

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

core/src/main/java/org/elasticsearch/cluster/routing/allocation/decider/EnableAllocationDecider.java

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,17 @@ public class EnableAllocationDecider extends AllocationDecider {
6363
public static final String NAME = "enable";
6464

6565
public static final Setting<Allocation> CLUSTER_ROUTING_ALLOCATION_ENABLE_SETTING =
66-
new Setting<>("cluster.routing.allocation.enable", Allocation.ALL.name(), Allocation::parse,
66+
new Setting<>("cluster.routing.allocation.enable", Allocation.ALL.toString(), Allocation::parse,
6767
Property.Dynamic, Property.NodeScope);
6868
public static final Setting<Allocation> INDEX_ROUTING_ALLOCATION_ENABLE_SETTING =
69-
new Setting<>("index.routing.allocation.enable", Allocation.ALL.name(), Allocation::parse,
69+
new Setting<>("index.routing.allocation.enable", Allocation.ALL.toString(), Allocation::parse,
7070
Property.Dynamic, Property.IndexScope);
7171

7272
public static final Setting<Rebalance> CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING =
73-
new Setting<>("cluster.routing.rebalance.enable", Rebalance.ALL.name(), Rebalance::parse,
73+
new Setting<>("cluster.routing.rebalance.enable", Rebalance.ALL.toString(), Rebalance::parse,
7474
Property.Dynamic, Property.NodeScope);
7575
public static final Setting<Rebalance> INDEX_ROUTING_REBALANCE_ENABLE_SETTING =
76-
new Setting<>("index.routing.rebalance.enable", Rebalance.ALL.name(), Rebalance::parse,
76+
new Setting<>("index.routing.rebalance.enable", Rebalance.ALL.toString(), Rebalance::parse,
7777
Property.Dynamic, Property.IndexScope);
7878

7979
private volatile Rebalance enableRebalance;
@@ -228,6 +228,11 @@ public static Allocation parse(String strValue) {
228228
}
229229
}
230230
}
231+
232+
@Override
233+
public String toString() {
234+
return name().toLowerCase(Locale.ROOT);
235+
}
231236
}
232237

233238
/**
@@ -255,6 +260,11 @@ public static Rebalance parse(String strValue) {
255260
}
256261
}
257262
}
263+
264+
@Override
265+
public String toString() {
266+
return name().toLowerCase(Locale.ROOT);
267+
}
258268
}
259269

260270
}

0 commit comments

Comments
 (0)