Skip to content

Commit 8c087f4

Browse files
committed
Tidy
1 parent 640f0da commit 8c087f4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void collectUsageStats(
4343
"transport_node_usage_stats_for_thread_pools_action"
4444
);
4545

46-
private final Map<String, NodeUsageStatsForThreadPools> lastNodeUsageStatsForThreadPools = new ConcurrentHashMap<>();
46+
private final Map<String, NodeUsageStatsForThreadPools> lastNodeUsageStatsPerNode = new ConcurrentHashMap<>();
4747

4848
/**
4949
* Collects the thread pool usage stats ({@link NodeUsageStatsForThreadPools}) for each node in the cluster.
@@ -57,7 +57,7 @@ public void collectUsageStats(
5757
) {
5858
var dataNodeIds = clusterState.nodes().getDataNodes().values().stream().map(DiscoveryNode::getId).toArray(String[]::new);
5959
// Discard last-seen values for any nodes no longer present in the cluster state
60-
lastNodeUsageStatsForThreadPools.keySet().retainAll(Arrays.asList(dataNodeIds));
60+
lastNodeUsageStatsPerNode.keySet().retainAll(Arrays.asList(dataNodeIds));
6161
if (clusterState.getMinTransportVersion().supports(TRANSPORT_NODE_USAGE_STATS_FOR_THREAD_POOLS_ACTION)) {
6262
client.execute(
6363
TransportNodeUsageStatsForThreadPoolsAction.TYPE,
@@ -74,7 +74,7 @@ private Map<String, NodeUsageStatsForThreadPools> replaceFailuresWithLastSeenVal
7474
) {
7575
final Map<String, NodeUsageStatsForThreadPools> returnedUsageStats = response.getAllNodeUsageStatsForThreadPools();
7676
// Update the last-seen usage stats
77-
this.lastNodeUsageStatsForThreadPools.putAll(returnedUsageStats);
77+
this.lastNodeUsageStatsPerNode.putAll(returnedUsageStats);
7878

7979
if (response.hasFailures() == false) {
8080
return returnedUsageStats;
@@ -83,7 +83,7 @@ private Map<String, NodeUsageStatsForThreadPools> replaceFailuresWithLastSeenVal
8383
// Add in the last-seen usage stats for any nodes that failed to respond
8484
final Map<String, NodeUsageStatsForThreadPools> cachedValuesForFailed = new HashMap<>(returnedUsageStats);
8585
for (FailedNodeException failedNodeException : response.failures()) {
86-
NodeUsageStatsForThreadPools nodeUsageStatsForThreadPools = lastNodeUsageStatsForThreadPools.get(failedNodeException.nodeId());
86+
final var nodeUsageStatsForThreadPools = lastNodeUsageStatsPerNode.get(failedNodeException.nodeId());
8787
if (nodeUsageStatsForThreadPools != null) {
8888
cachedValuesForFailed.put(failedNodeException.nodeId(), nodeUsageStatsForThreadPools);
8989
}

0 commit comments

Comments
 (0)