ramkrish86 commented on a change in pull request #889: HBASE-23066 - Allow
cache on write during compactions when prefetchin…
URL: https://github.com/apache/hbase/pull/889#discussion_r355271616
##########
File path:
hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCacheOnWrite.java
##########
@@ -448,16 +455,34 @@ private void
testNotCachingDataBlocksDuringCompactionInternals(boolean useTags)
}
region.flush(true);
}
+
clearBlockCache(blockCache);
assertEquals(0, blockCache.getBlockCount());
+
region.compact(false);
LOG.debug("compactStores() returned");
+ boolean dataBlockCached = false;
for (CachedBlock block: blockCache) {
- assertNotEquals(BlockType.ENCODED_DATA, block.getBlockType());
- assertNotEquals(BlockType.DATA, block.getBlockType());
+ if (BlockType.ENCODED_DATA.equals(block.getBlockType())
+ || BlockType.DATA.equals(block.getBlockType())) {
+ dataBlockCached = true;
+ break;
+ }
}
+
+ // Data blocks should be cached in instances where we are caching blocks
on write. In the case
+ // of testing
+ // BucketCache, we cannot verify block type as it is not stored in the
cache.
Review comment:
Seems it is only the iterator issue - that is being used 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