apurtell commented on code in PR #5239:
URL: https://github.com/apache/hbase/pull/5239#discussion_r1198367987
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java:
##########
@@ -592,10 +593,27 @@ public int evictBlocksByHfileName(String hfileName) {
* @return the heap size of evicted block
*/
protected long evictBlock(LruCachedBlock block, boolean
evictedByEvictionProcess) {
- LruCachedBlock previous = map.remove(block.getCacheKey());
- if (previous == null) {
+ // We need something effectively final for the lambda.
+ final AtomicBoolean evicted = new AtomicBoolean(false);
+ map.computeIfPresent(block.getCacheKey(), (k, v) -> {
Review Comment:
Let me also bullet proof the lambda against multiple invocation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]