You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by Jonathan Gray <jg...@apache.org> on 2010/10/30 04:16:13 UTC

Review Request: HBASE-2253: Show Block cache hit ratio for requests where cacheBlocks=true

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://review.cloudera.org/r/1131/
-----------------------------------------------------------

Review request for hbase, stack and Jean-Daniel Cryans.


Summary
-------

LruBlockCache now tracks the hitCachingCount and missCachingCount.  These are hits/misses when caching of blocks is turned on so the hitCachingRatio does not include the impact of reads which were not going to cache.

Exposes this new ratio in metrics and in all of the logging/toString methods.

Small optimization in CacheStats to not track hit/miss/access, just compute access from hit+miss.


This addresses bug HBASE-2253.
    http://issues.apache.org/jira/browse/HBASE-2253


Diffs
-----

  trunk/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockCache.java 1028936 
  trunk/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java 1028936 
  trunk/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java 1028936 
  trunk/src/main/java/org/apache/hadoop/hbase/io/hfile/SimpleBlockCache.java 1028936 
  trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java 1028936 
  trunk/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java 1028936 
  trunk/src/test/java/org/apache/hadoop/hbase/io/hfile/TestLruBlockCache.java 1028936 

Diff: http://review.cloudera.org/r/1131/diff


Testing
-------

Ran the block cache test.


Thanks,

Jonathan


Re: Review Request: HBASE-2253: Show Block cache hit ratio for requests where cacheBlocks=true

Posted by Jonathan Gray <jg...@apache.org>.

> On 2010-10-29 21:32:46, stack wrote:
> > trunk/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java, line 581
> > <http://review.cloudera.org/r/1131/diff/1/?file=16255#file16255line581>
> >
> >     These need documentation.  Should these be called hitCacheCount rather than hitCachingCount?

Cache seems about the same to me as Caching, though I think of this more as "the hit count when/while caching".  I wrote a bunch of documentation on the declaration of the counters and referenced this jira.


- Jonathan


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://review.cloudera.org/r/1131/#review1721
-----------------------------------------------------------


On 2010-10-29 19:16:13, Jonathan Gray wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://review.cloudera.org/r/1131/
> -----------------------------------------------------------
> 
> (Updated 2010-10-29 19:16:13)
> 
> 
> Review request for hbase, stack and Jean-Daniel Cryans.
> 
> 
> Summary
> -------
> 
> LruBlockCache now tracks the hitCachingCount and missCachingCount.  These are hits/misses when caching of blocks is turned on so the hitCachingRatio does not include the impact of reads which were not going to cache.
> 
> Exposes this new ratio in metrics and in all of the logging/toString methods.
> 
> Small optimization in CacheStats to not track hit/miss/access, just compute access from hit+miss.
> 
> 
> This addresses bug HBASE-2253.
>     http://issues.apache.org/jira/browse/HBASE-2253
> 
> 
> Diffs
> -----
> 
>   trunk/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockCache.java 1028936 
>   trunk/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java 1028936 
>   trunk/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java 1028936 
>   trunk/src/main/java/org/apache/hadoop/hbase/io/hfile/SimpleBlockCache.java 1028936 
>   trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java 1028936 
>   trunk/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java 1028936 
>   trunk/src/test/java/org/apache/hadoop/hbase/io/hfile/TestLruBlockCache.java 1028936 
> 
> Diff: http://review.cloudera.org/r/1131/diff
> 
> 
> Testing
> -------
> 
> Ran the block cache test.
> 
> 
> Thanks,
> 
> Jonathan
> 
>


Re: Review Request: HBASE-2253: Show Block cache hit ratio for requests where cacheBlocks=true

Posted by st...@duboce.net.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://review.cloudera.org/r/1131/#review1721
-----------------------------------------------------------

Ship it!


This is fine to commit but only after these new params have gotten more documentation.  Its not easy discern what hitCachingCount refers too (There is also a question of whether these variables are properly named -- see what you think).  But I'm good to commit with these varnames as long as they get docing around their declaration in particular.


trunk/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java
<http://review.cloudera.org/r/1131/#comment5654>

    These need documentation.  Should these be called hitCacheCount rather than hitCachingCount?


- stack


On 2010-10-29 19:16:13, Jonathan Gray wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://review.cloudera.org/r/1131/
> -----------------------------------------------------------
> 
> (Updated 2010-10-29 19:16:13)
> 
> 
> Review request for hbase, stack and Jean-Daniel Cryans.
> 
> 
> Summary
> -------
> 
> LruBlockCache now tracks the hitCachingCount and missCachingCount.  These are hits/misses when caching of blocks is turned on so the hitCachingRatio does not include the impact of reads which were not going to cache.
> 
> Exposes this new ratio in metrics and in all of the logging/toString methods.
> 
> Small optimization in CacheStats to not track hit/miss/access, just compute access from hit+miss.
> 
> 
> This addresses bug HBASE-2253.
>     http://issues.apache.org/jira/browse/HBASE-2253
> 
> 
> Diffs
> -----
> 
>   trunk/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockCache.java 1028936 
>   trunk/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java 1028936 
>   trunk/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java 1028936 
>   trunk/src/main/java/org/apache/hadoop/hbase/io/hfile/SimpleBlockCache.java 1028936 
>   trunk/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java 1028936 
>   trunk/src/main/java/org/apache/hadoop/hbase/regionserver/metrics/RegionServerMetrics.java 1028936 
>   trunk/src/test/java/org/apache/hadoop/hbase/io/hfile/TestLruBlockCache.java 1028936 
> 
> Diff: http://review.cloudera.org/r/1131/diff
> 
> 
> Testing
> -------
> 
> Ran the block cache test.
> 
> 
> Thanks,
> 
> Jonathan
> 
>