saintstack commented on a change in pull request #1200: HBASE 23887 BlockCache 
performance improve
URL: https://github.com/apache/hbase/pull/1200#discussion_r383669830
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java
 ##########
 @@ -400,16 +413,24 @@ private Cacheable asReferencedHeapBlock(Cacheable buf) {
    */
   @Override
   public void cacheBlock(BlockCacheKey cacheKey, Cacheable buf, boolean 
inMemory) {
+    if (cacheDataBlockPercent != 100 && buf.getBlockType().isData()) {
+      // Don't cache this DATA block if we have limit on BlockCache,
+      // good for performance (HBASE-23887)
+      if (cacheKey.getOffset() % 100 >= cacheDataBlockPercent) {
 
 Review comment:
   What is offset here? Bytes into a block? What is this modulus on offset 
doing? We might cache only some of the data blocks?
   
   I don't understand how this gets you the graphs you show in the JIRA. How do 
you explain it?

----------------------------------------------------------------
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

Reply via email to