Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
Signed-off-by: Kiran Prakash <[email protected]>
  • Loading branch information
kiranprakash154 committed Apr 4, 2024
1 parent ac1464f commit f2d72f2
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,8 @@ private void incrementStaleKeysCount(CleanupKey cleanupKey) {
// Aggregate and add to staleKeysCount atomically if readerCacheKeyId is null
int totalSum = countMap.values().stream().mapToInt(Integer::intValue).sum();
staleKeysCount.addAndGet(totalSum);
// return the updated map
return countMap;
// Return null to automatically remove the mapping for shardId
return null;
} else {
// Update staleKeysCount based on specific readerCacheKeyId, then remove it from the countMap
countMap.computeIfPresent(cleanupKey.readerCacheKeyId, (readerCacheKey, count) -> {
Expand All @@ -573,7 +573,8 @@ private void incrementStaleKeysCount(CleanupKey cleanupKey) {
});
// Check if countMap is empty after removal to decide if we need to remove the shardId entry
if (countMap.isEmpty()) {
return null; // Returning null removes the entry for shardId
// Returning null removes the entry for shardId
return null;
}
}
// Return the modified countMap
Expand Down

0 comments on commit f2d72f2

Please sign in to comment.