Apache9 commented on a change in pull request #320: HBASE-21879 Read HFile's
block to ByteBuffer directly instead of to byte for reducing young gc purpose
URL: https://github.com/apache/hbase/pull/320#discussion_r295308074
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java
##########
@@ -481,7 +512,14 @@ private long updateSizeMetrics(LruCachedBlock cb, boolean
evict) {
@Override
public Cacheable getBlock(BlockCacheKey cacheKey, boolean caching, boolean
repeat,
boolean updateCacheMetrics) {
- LruCachedBlock cb = map.get(cacheKey);
+ LruCachedBlock cb = map.computeIfPresent(cacheKey, (key, val) -> {
Review comment:
computeIfPresent is only atomic for ConcurrentHashMap, for other maps such
as ConcurrentSkipListMap, the lambda function may be called multiple times. Is
it safe here?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services