Skip to content

Commit

Permalink
update code comments
Browse files Browse the repository at this point in the history
Signed-off-by: Kiran Prakash <awskiran@amazon.com>
  • Loading branch information
kiranprakash154 committed Apr 23, 2024
1 parent 5a15c87 commit 430e57c
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -524,15 +524,13 @@ private void updateStaleCountOnCacheInsert(CleanupKey cleanupKey) {
}

/**
* Updates the cleanupKeyToCountMap and staleKeysCount when a cache eviction occurs.
* Handles the eviction of a cache entry.
*
* <p>This method is called when an entry is evicted from the cache.
* It decrements the count of the entry in the cleanupKeyToCountMap.
* It also decrements the staleKeysCount only if the entry was accounted.
* If the count of the CleanupKey becomes zero, it removes the CleanupKey from the map.
*
* <p> We update the cleanupKeyToCountMap on every key removed from cache
* except for the keys removed with reason Replaced
* We consider all removal notifications except with the reason Replaced
* {@link #incrementStaleKeysCount} would have removed the entries from the map and increment the {@link #staleKeysCount}
* Hence we decrement {@link #staleKeysCount} if we do not find the shardId or readerCacheKeyId in the map.
* Skip decrementing staleKeysCount if we find the shardId or readerCacheKeyId in the map since it would have not been accounted for in the staleKeysCount in
*
* @param cleanupKey the CleanupKey that has been evicted from the cache
* @param notification RemovalNotification of the cache entry evicted
Expand Down

0 comments on commit 430e57c

Please sign in to comment.