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

Nick Dimiduk commented on HBASE-14314:
--------------------------------------

{quote}
+  String BLOCK_CACHE_PRIMARY_HIT_COUNT = "primary.blockCacheHitCount";
{quote}

Name is inconsistent with other metrics, isn't it? Nowhere else do we have 
dotted metrics names. How about 'blockCacheHitCountPrimary'? Ditto for 
primary.blockCacheMissCount, primary.blockCacheEvictionCount.

{quote}
+  String L1_BLOCK_CACHE_EVICTION_COUNT = "l1.blockCacheEvictionCount";
...
+  /**
+   * Get the number of items evicted from the L1 block cache.
+   */
+  long getL1BlockCacheEvictedCount();
{quote}

L1 level statistics as well? Are we tracking all L1 metrics or just evictions? 
Don't we want hits/misses/&c as well? What about L2 stats? I see nothing about 
L1 in the changes to {{CacheStats.java}}, so maybe this was not intended to be 
part of the patch. How about we examine this in a separate JIRA?

Over in {{BlockCacheKey.java}}, there's
{quote}
+  private final boolean isReplicaBlock;
...
+  public BlockCacheKey(String hfileName, long offset, boolean isReplica) {
{quote}
 
but then

{quote}
+  public boolean isPrimary() \{
+    return !isReplicaBlock;
+  \}
{quote}

Why the logical inversion? Can we keep this consistent -- all {{isPrimary}} or 
all {{isReplica}}? Seems like the stores want to refer to these as "replica or 
not" while the cache as "primary or not". Would be good to choose one way or 
the other.



> Metrics for block cache should take region replicas into account
> ----------------------------------------------------------------
>
>                 Key: HBASE-14314
>                 URL: https://issues.apache.org/jira/browse/HBASE-14314
>             Project: HBase
>          Issue Type: Improvement
>          Components: metrics, regionserver
>            Reporter: Ted Yu
>            Assignee: Ted Yu
>         Attachments: 14314-v1.txt, 14314-v2.txt, 14314-v3.txt
>
>
> Currently metrics for block cache are aggregates in the sense that they don't 
> distinguish primary from secondary / tertiary replicas.
> This JIRA separates the block cache metrics for primary region replica from 
> the aggregate.



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

Reply via email to