Apache9 commented on code in PR #5530:
URL: https://github.com/apache/hbase/pull/5530#discussion_r1400744146
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java:
##########
@@ -221,13 +221,14 @@ public class BucketCache implements BlockCache, HeapSize {
*/
transient final IdReadWriteLock<Long> offsetLock;
- private final NavigableSet<BlockCacheKey> blocksByHFile = new
ConcurrentSkipListSet<>((a, b) -> {
- int nameComparison = a.getHfileName().compareTo(b.getHfileName());
- if (nameComparison != 0) {
- return nameComparison;
- }
- return Long.compare(a.getOffset(), b.getOffset());
- });
+ protected final NavigableSet<BlockCacheKey> blocksByHFile =
Review Comment:
Just change it to package private if we want to access it in test
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java:
##########
@@ -642,12 +643,14 @@ void blockEvicted(BlockCacheKey cacheKey, BucketEntry
bucketEntry, boolean decre
blocksByHFile.remove(cacheKey);
if (decrementBlockNumber) {
this.blockNumber.decrement();
+ if (ioEngine.isPersistent()) {
+ removeFileFromPrefetch(cacheKey.getHfileName());
+ }
}
if (evictedByEvictionProcess) {
cacheStats.evicted(bucketEntry.getCachedTime(), cacheKey.isPrimary());
Review Comment:
So we could throw exceptions 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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]