@@ -60,6 +60,12 @@ public class DiskThresholdSettings {
6060 Setting .Property .Dynamic ,
6161 Setting .Property .NodeScope
6262 );
63+ public static final Setting <Boolean > CLUSTER_ROUTING_ALLOCATION_WARM_DISK_THRESHOLD_ENABLED_SETTING = Setting .boolSetting (
64+ "cluster.routing.allocation.disk.warm_threshold_enabled" ,
65+ true ,
66+ Setting .Property .Dynamic ,
67+ Setting .Property .NodeScope
68+ );
6369 public static final Setting <Boolean > ENABLE_FOR_SINGLE_DATA_NODE = Setting .boolSetting (
6470 "cluster.routing.allocation.disk.watermark.enable_for_single_data_node" ,
6571 false ,
@@ -118,6 +124,7 @@ public class DiskThresholdSettings {
118124 private volatile boolean includeRelocations ;
119125 private volatile boolean createIndexBlockAutoReleaseEnabled ;
120126 private volatile boolean enabled ;
127+ private volatile boolean warmThresholdEnabled ;
121128 private volatile TimeValue rerouteInterval ;
122129 private volatile Double freeDiskThresholdFloodStage ;
123130 private volatile ByteSizeValue freeBytesThresholdFloodStage ;
@@ -144,13 +151,15 @@ public DiskThresholdSettings(Settings settings, ClusterSettings clusterSettings)
144151 this .includeRelocations = CLUSTER_ROUTING_ALLOCATION_INCLUDE_RELOCATIONS_SETTING .get (settings );
145152 this .rerouteInterval = CLUSTER_ROUTING_ALLOCATION_REROUTE_INTERVAL_SETTING .get (settings );
146153 this .enabled = CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED_SETTING .get (settings );
154+ this .warmThresholdEnabled = CLUSTER_ROUTING_ALLOCATION_WARM_DISK_THRESHOLD_ENABLED_SETTING .get (settings );
147155 this .createIndexBlockAutoReleaseEnabled = CLUSTER_CREATE_INDEX_BLOCK_AUTO_RELEASE .get (settings );
148156 clusterSettings .addSettingsUpdateConsumer (CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK_SETTING , this ::setLowWatermark );
149157 clusterSettings .addSettingsUpdateConsumer (CLUSTER_ROUTING_ALLOCATION_HIGH_DISK_WATERMARK_SETTING , this ::setHighWatermark );
150158 clusterSettings .addSettingsUpdateConsumer (CLUSTER_ROUTING_ALLOCATION_DISK_FLOOD_STAGE_WATERMARK_SETTING , this ::setFloodStage );
151159 clusterSettings .addSettingsUpdateConsumer (CLUSTER_ROUTING_ALLOCATION_INCLUDE_RELOCATIONS_SETTING , this ::setIncludeRelocations );
152160 clusterSettings .addSettingsUpdateConsumer (CLUSTER_ROUTING_ALLOCATION_REROUTE_INTERVAL_SETTING , this ::setRerouteInterval );
153161 clusterSettings .addSettingsUpdateConsumer (CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED_SETTING , this ::setEnabled );
162+ clusterSettings .addSettingsUpdateConsumer (CLUSTER_ROUTING_ALLOCATION_WARM_DISK_THRESHOLD_ENABLED_SETTING , this ::setWarmThresholdEnabled );
154163 clusterSettings .addSettingsUpdateConsumer (CLUSTER_CREATE_INDEX_BLOCK_AUTO_RELEASE , this ::setCreateIndexBlockAutoReleaseEnabled );
155164 }
156165
@@ -316,6 +325,10 @@ private void setEnabled(boolean enabled) {
316325 this .enabled = enabled ;
317326 }
318327
328+ private void setWarmThresholdEnabled (boolean enabled ) {
329+ this .warmThresholdEnabled = enabled ;
330+ }
331+
319332 private void setLowWatermark (String lowWatermark ) {
320333 // Watermark is expressed in terms of used data, but we need "free" data watermark
321334 this .lowWatermarkRaw = lowWatermark ;
@@ -395,6 +408,10 @@ public boolean isEnabled() {
395408 return enabled ;
396409 }
397410
411+ public boolean isWarmThresholdEnabled () {
412+ return warmThresholdEnabled ;
413+ }
414+
398415 public TimeValue getRerouteInterval () {
399416 return rerouteInterval ;
400417 }
0 commit comments