@@ -83,22 +83,22 @@ public class InternalClusterInfoService implements ClusterInfoService, ClusterSt
8383 Property .NodeScope
8484 );
8585
86- public static final Setting <Boolean > CLUSTER_ROUTING_ALLOCATION_SHARD_HEAP_THRESHOLD_DECIDER_ENABLED = Setting .boolSetting (
87- "cluster.routing.allocation.shard_heap .threshold_enabled" ,
86+ public static final Setting <Boolean > CLUSTER_ROUTING_ALLOCATION_ESTIMATED_HEAP_THRESHOLD_DECIDER_ENABLED = Setting .boolSetting (
87+ "cluster.routing.allocation.estimated_heap .threshold_enabled" ,
8888 false ,
8989 Property .Dynamic ,
9090 Property .NodeScope
9191 );
9292
9393 private volatile boolean diskThresholdEnabled ;
94- private volatile boolean shardHeapThresholdEnabled ;
94+ private volatile boolean estimatedHeapThresholdEnabled ;
9595 private volatile TimeValue updateFrequency ;
9696 private volatile TimeValue fetchTimeout ;
9797
9898 private volatile Map <String , DiskUsage > leastAvailableSpaceUsages ;
9999 private volatile Map <String , DiskUsage > mostAvailableSpaceUsages ;
100100 private volatile Map <String , ByteSizeValue > maxHeapPerNode ;
101- private volatile Map <String , Long > shardHeapUsagePerNode ;
101+ private volatile Map <String , Long > estimatedHeapUsagePerNode ;
102102 private volatile IndicesStatsSummary indicesStatsSummary ;
103103
104104 private final ThreadPool threadPool ;
@@ -107,7 +107,7 @@ public class InternalClusterInfoService implements ClusterInfoService, ClusterSt
107107
108108 private final Object mutex = new Object ();
109109 private final List <ActionListener <ClusterInfo >> nextRefreshListeners = new ArrayList <>();
110- private final ShardHeapUsageCollector shardHeapUsageCollector ;
110+ private final EstimatedHeapUsageCollector estimatedHeapUsageCollector ;
111111
112112 private AsyncRefresh currentRefresh ;
113113 private RefreshScheduler refreshScheduler ;
@@ -118,16 +118,16 @@ public InternalClusterInfoService(
118118 ClusterService clusterService ,
119119 ThreadPool threadPool ,
120120 Client client ,
121- ShardHeapUsageCollector shardHeapUsageCollector
121+ EstimatedHeapUsageCollector estimatedHeapUsageCollector
122122 ) {
123123 this .leastAvailableSpaceUsages = Map .of ();
124124 this .mostAvailableSpaceUsages = Map .of ();
125125 this .maxHeapPerNode = Map .of ();
126- this .shardHeapUsagePerNode = Map .of ();
126+ this .estimatedHeapUsagePerNode = Map .of ();
127127 this .indicesStatsSummary = IndicesStatsSummary .EMPTY ;
128128 this .threadPool = threadPool ;
129129 this .client = client ;
130- this .shardHeapUsageCollector = shardHeapUsageCollector ;
130+ this .estimatedHeapUsageCollector = estimatedHeapUsageCollector ;
131131 this .updateFrequency = INTERNAL_CLUSTER_INFO_UPDATE_INTERVAL_SETTING .get (settings );
132132 this .fetchTimeout = INTERNAL_CLUSTER_INFO_TIMEOUT_SETTING .get (settings );
133133 this .diskThresholdEnabled = DiskThresholdSettings .CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED_SETTING .get (settings );
@@ -139,17 +139,17 @@ public InternalClusterInfoService(
139139 this ::setDiskThresholdEnabled
140140 );
141141 clusterSettings .initializeAndWatch (
142- CLUSTER_ROUTING_ALLOCATION_SHARD_HEAP_THRESHOLD_DECIDER_ENABLED ,
143- this ::setShardHeapThresholdEnabled
142+ CLUSTER_ROUTING_ALLOCATION_ESTIMATED_HEAP_THRESHOLD_DECIDER_ENABLED ,
143+ this ::setEstimatedHeapThresholdEnabled
144144 );
145145 }
146146
147147 private void setDiskThresholdEnabled (boolean diskThresholdEnabled ) {
148148 this .diskThresholdEnabled = diskThresholdEnabled ;
149149 }
150150
151- private void setShardHeapThresholdEnabled (boolean shardHeapThresholdEnabled ) {
152- this .shardHeapThresholdEnabled = shardHeapThresholdEnabled ;
151+ private void setEstimatedHeapThresholdEnabled (boolean estimatedHeapThresholdEnabled ) {
152+ this .estimatedHeapThresholdEnabled = estimatedHeapThresholdEnabled ;
153153 }
154154
155155 private void setFetchTimeout (TimeValue fetchTimeout ) {
@@ -202,8 +202,8 @@ void execute() {
202202
203203 try (var ignoredRefs = fetchRefs ) {
204204 maybeFetchIndicesStats (diskThresholdEnabled );
205- maybeFetchNodeStats (diskThresholdEnabled || shardHeapThresholdEnabled );
206- maybeFetchNodesHeapUsage ( shardHeapThresholdEnabled );
205+ maybeFetchNodeStats (diskThresholdEnabled || estimatedHeapThresholdEnabled );
206+ maybeFetchNodesEstimatedHeapUsage ( estimatedHeapThresholdEnabled );
207207 }
208208 }
209209
@@ -231,28 +231,28 @@ private void maybeFetchNodeStats(boolean shouldFetch) {
231231 }
232232 }
233233
234- private void maybeFetchNodesHeapUsage (boolean shouldFetch ) {
234+ private void maybeFetchNodesEstimatedHeapUsage (boolean shouldFetch ) {
235235 if (shouldFetch ) {
236236 try (var ignored = threadPool .getThreadContext ().clearTraceContext ()) {
237- fetchNodesHeapUsage ();
237+ fetchNodesEstimatedHeapUsage ();
238238 }
239239 } else {
240- logger .trace ("skipping collecting shard heap usage from cluster, notifying listeners with empty shard heap usage" );
241- shardHeapUsagePerNode = Map .of ();
240+ logger .trace ("skipping collecting estimated heap usage from cluster, notifying listeners with empty estimated heap usage" );
241+ estimatedHeapUsagePerNode = Map .of ();
242242 }
243243 }
244244
245- private void fetchNodesHeapUsage () {
246- shardHeapUsageCollector .collectClusterHeapUsage (ActionListener .releaseAfter (new ActionListener <>() {
245+ private void fetchNodesEstimatedHeapUsage () {
246+ estimatedHeapUsageCollector .collectClusterHeapUsage (ActionListener .releaseAfter (new ActionListener <>() {
247247 @ Override
248- public void onResponse (Map <String , Long > currentShardHeapUsages ) {
249- shardHeapUsagePerNode = currentShardHeapUsages ;
248+ public void onResponse (Map <String , Long > currentEstimatedHeapUsages ) {
249+ estimatedHeapUsagePerNode = currentEstimatedHeapUsages ;
250250 }
251251
252252 @ Override
253253 public void onFailure (Exception e ) {
254254 logger .warn ("failed to fetch heap usage for nodes" , e );
255- shardHeapUsagePerNode = Map .of ();
255+ estimatedHeapUsagePerNode = Map .of ();
256256 }
257257 }, fetchRefs .acquire ()));
258258 }
@@ -479,11 +479,11 @@ private boolean shouldRefresh() {
479479 @ Override
480480 public ClusterInfo getClusterInfo () {
481481 final IndicesStatsSummary indicesStatsSummary = this .indicesStatsSummary ; // single volatile read
482- final Map <String , ShardHeapUsage > shardHeapUsages = new HashMap <>();
482+ final Map <String , EstimatedHeapUsage > estimatedHeapUsages = new HashMap <>();
483483 maxHeapPerNode .forEach ((nodeId , maxHeapSize ) -> {
484- final Long estimatedHeapUsage = shardHeapUsagePerNode .get (nodeId );
484+ final Long estimatedHeapUsage = estimatedHeapUsagePerNode .get (nodeId );
485485 if (estimatedHeapUsage != null ) {
486- shardHeapUsages .put (nodeId , new ShardHeapUsage (nodeId , maxHeapSize .getBytes (), estimatedHeapUsage ));
486+ estimatedHeapUsages .put (nodeId , new EstimatedHeapUsage (nodeId , maxHeapSize .getBytes (), estimatedHeapUsage ));
487487 }
488488 });
489489 return new ClusterInfo (
@@ -493,7 +493,7 @@ public ClusterInfo getClusterInfo() {
493493 indicesStatsSummary .shardDataSetSizes ,
494494 indicesStatsSummary .dataPath ,
495495 indicesStatsSummary .reservedSpace ,
496- shardHeapUsages
496+ estimatedHeapUsages
497497 );
498498 }
499499
0 commit comments