hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guangxu Cheng (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HBASE-19561) maxCacheSize in CacheEvictionStats can't be accumulated repeatedly When dealing with each region
Date Wed, 20 Dec 2017 03:56:00 GMT
Guangxu Cheng created HBASE-19561:
-------------------------------------

             Summary: maxCacheSize in CacheEvictionStats can't be accumulated repeatedly When
dealing with each region
                 Key: HBASE-19561
                 URL: https://issues.apache.org/jira/browse/HBASE-19561
             Project: HBase
          Issue Type: Bug
    Affects Versions: 2.0.0
            Reporter: Guangxu Cheng
            Assignee: Guangxu Cheng


{code:title=HRegionServer.java|borderStyle=solid}
  public CacheEvictionStats clearRegionBlockCache(Region region) {
    BlockCache blockCache = this.getCacheConfig().getBlockCache();
    long evictedBlocks = 0;

    for(Store store : region.getStores()) {
      for(StoreFile hFile : store.getStorefiles()) {
        evictedBlocks += blockCache.evictBlocksByHfileName(hFile.getPath().getName());
      }
    }

    return CacheEvictionStats.builder()
        .withEvictedBlocks(evictedBlocks)
        .withMaxCacheSize(blockCache.getMaxSize())
        .build();
  }
{code}

BlockCache is the regionserver level object.If we accumulate this value for each region, we
will get a wrong result.
The value of maxCacheSize should be set to BlockCache.getMaxSize() after processing all the
regions on this regionserver.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message