Skip to content

Commit ef2bffa

Browse files
author
Peter Alfonsi
committed
Reworded description comment
Signed-off-by: Peter Alfonsi <petealft@amazon.com>
1 parent 8bb6942 commit ef2bffa

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

modules/cache-common/src/main/java/org/opensearch/cache/common/tier/TieredSpilloverCacheStatsHolder.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,17 @@
1515
import java.util.function.Consumer;
1616

1717
/**
18-
* A tier-aware version of DefaultCacheStatsHolder. Overrides the incrementer functions, as we cannot just add the on-heap
19-
* and disk stats to get a total for the cache as a whole. For example, if the heap tier has 5 misses and the disk tier
20-
* has 4, the total cache has had 4 misses, not 9. The same goes for evictions. Other stats values add normally.
18+
* A tier-aware version of DefaultCacheStatsHolder. Overrides the incrementer functions, as we can't just add the on-heap
19+
* and disk stats to get a total for the cache as a whole. If the disk tier is present, the total hits, size, and entries
20+
* should be the sum of both tiers' values, but the total misses and evictions should be the disk tier's values.
21+
* When the disk tier isn't present, on-heap misses and evictions should contribute to the total.
22+
*
23+
* For example, if the heap tier has 5 misses and the disk tier has 4, the total cache has had 4 misses, not 9.
24+
* The same goes for evictions. Other stats values add normally.
25+
*
2126
* This means for misses and evictions, if we are incrementing for the on-heap tier and the disk tier is present,
22-
* we have to increment only the leaf nodes corresponding to the on-heap tier itself, and not its ancestors.
23-
* If the disk tier is not present, we do increment the ancestor nodes.
27+
* we have to increment only the leaf nodes corresponding to the on-heap tier itself, and not its ancestors,
28+
* which correspond to totals including both tiers. If the disk tier is not present, we do increment the ancestor nodes.
2429
*/
2530
public class TieredSpilloverCacheStatsHolder extends DefaultCacheStatsHolder {
2631

0 commit comments

Comments
 (0)