[ 
https://issues.apache.org/jira/browse/HBASE-14727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15085040#comment-15085040
 ] 

Eungsop Yoo commented on HBASE-14727:
-------------------------------------

{quote}
149 /** the size of cache for the region */
150 optional uint64 cache_size = 22;
What is a region cache size? We usually do the cache by regionserver, not by 
region. Is this the amount of the cache occupied by the region summing the size 
of all the cached blocks for a region? Is so, tighten the comment/description 
I'd say.
{quote}
Yes, I'll update it.

{quote}
Do we need this:
143 /** the number of cache miss count for the region */
144 optional uint64 cache_miss_count = 20;
We have the cache hit number and elsewhere we have overall hits so miss would 
be the difference? Do we need to send this one over?
{quote}
Instead of adding request(hit + miss) count, I added this to PB. It is used to 
calculate cache hit ratio.(It is mentioned later some more.)
The new fields are added to PB to expose new metrics to clients out of region 
servers. So now clients can query the metrics related to block cache for 
regions by calling Admin.getClusterStatus().getLoad() like other metrics such 
as read request count, write request count, etc.

{quote}
I think we do this elsewhere but that doesn't mean it a good idea (smile):
155 /** the current cache hit ratio for the region */
156 optional float cache_hit_ratio = 24;
The above can be calculated from cache hit rate or overall hit rate
... but this latter might be ok.
{quote}
This can be calculated at client side with hit and miss count for a region. So 
this can be removed from PB.

{quote}
When you add region to BlockCacheKey, is it the name or the id that you use? It 
looks like the name given you are parsing the file path. The file path will not 
always have the region id in it (it won't in hbase 2.0.0). Do you have to get 
it from the filepath?
{quote}
I used the the encoded region name parsed form the file path. Do you mean that 
parsing the encoded region name from the file path is impossible in HBase 2.0.0?
If it is impossible, I need to find another way. 

{quote}
What does the CacheStatsChore do? Why we need it now?
{quote}
Block cache metrics for regions are implemented in CacheStats class. The 
instance of CacheStats belongs to BlockCache and the instance of BlockCache is 
a singleton. I need to update the metrics when regions are moved or split. But 
I could not update the block cache metrics for regions as the region metrics 
belong to HRegion. So I made the chore to clean up the stat entries related to 
regions that are not online. Is there any suggestion?

> Add block cache stats for regions
> ---------------------------------
>
>                 Key: HBASE-14727
>                 URL: https://issues.apache.org/jira/browse/HBASE-14727
>             Project: HBase
>          Issue Type: New Feature
>            Reporter: Eungsop Yoo
>            Priority: Minor
>         Attachments: HBASE-14727-v1.patch, HBASE-14727-v2.patch, 
> HBASE-14727-v3.patch, HBASE-14727-v4.patch, HBASE-14727.patch, 
> rs-web-ui-v2.png
>
>
> The stats of block cache are calculated at region server level only. So at 
> region level, we could not know about the numbers of blocks cached, the sizes 
> of cached blocks, the numbers of cache hit, etc. I suggest to add the stats 
> of block cache at region level.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to