Skip to content

Commit 212186a

Browse files
committed
minor cleanup
1 parent 41bdbea commit 212186a

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

server/src/main/java/org/elasticsearch/action/admin/indices/stats/CommonStats.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public static CommonStats getShardLevelStats(
165165
IndicesQueryCache indicesQueryCache,
166166
IndexShard indexShard,
167167
CommonStatsFlags flags,
168-
java.util.Map<org.elasticsearch.index.shard.ShardId, Long> precomputedSharedRam
168+
Long precomputedSharedRam
169169
) {
170170
// Filter shard level flags
171171
CommonStatsFlags filteredFlags = flags.clone();
@@ -187,11 +187,8 @@ public static CommonStats getShardLevelStats(
187187
case Flush -> stats.flush = indexShard.flushStats();
188188
case Warmer -> stats.warmer = indexShard.warmerStats();
189189
case QueryCache -> {
190-
if (precomputedSharedRam != null && precomputedSharedRam.containsKey(indexShard.shardId())) {
191-
stats.queryCache = indicesQueryCache.getStats(
192-
indexShard.shardId(),
193-
precomputedSharedRam.get(indexShard.shardId())
194-
);
190+
if (precomputedSharedRam != null) {
191+
stats.queryCache = indicesQueryCache.getStats(indexShard.shardId(), precomputedSharedRam);
195192
} else {
196193
stats.queryCache = indicesQueryCache.getStats(indexShard.shardId());
197194
}

server/src/main/java/org/elasticsearch/indices/IndicesQueryCache.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import java.io.Closeable;
3333
import java.io.IOException;
3434
import java.util.Collections;
35-
import java.util.HashMap;
3635
import java.util.IdentityHashMap;
3736
import java.util.Map;
3837
import java.util.Set;

server/src/main/java/org/elasticsearch/indices/IndicesService.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -552,12 +552,7 @@ static Map<Index, List<IndexShardStats>> statsByShard(final IndicesService indic
552552
}
553553
}
554554
try {
555-
final IndexShardStats indexShardStats = indicesService.indexShardStats(
556-
indicesService,
557-
indexShard,
558-
flags,
559-
java.util.Collections.singletonMap(shardId, sharedRam)
560-
);
555+
final IndexShardStats indexShardStats = indicesService.indexShardStats(indicesService, indexShard, flags, sharedRam);
561556
if (indexShardStats == null) {
562557
continue;
563558
}
@@ -582,7 +577,7 @@ IndexShardStats indexShardStats(
582577
final IndicesService indicesService,
583578
final IndexShard indexShard,
584579
final CommonStatsFlags flags,
585-
Map<org.elasticsearch.index.shard.ShardId, Long> precomputedSharedRam
580+
Long precomputedSharedRam
586581
) {
587582
if (indexShard.routingEntry() == null) {
588583
return null;

0 commit comments

Comments
 (0)