|
15 | 15 | import java.util.function.Consumer;
|
16 | 16 |
|
17 | 17 | /**
|
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 | + * |
21 | 26 | * 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. |
24 | 29 | */
|
25 | 30 | public class TieredSpilloverCacheStatsHolder extends DefaultCacheStatsHolder {
|
26 | 31 |
|
|
0 commit comments