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

ASF GitHub Bot commented on HDFS-16882:
---------------------------------------

tomscut commented on code in PR #5276:
URL: https://github.com/apache/hadoop/pull/5276#discussion_r1063045690


##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/resolver/MountTableResolver.java:
##########
@@ -97,6 +99,8 @@
   private final TreeMap<String, MountTable> tree = new TreeMap<>();
   /** Path -> Remote location. */
   private final Cache<String, PathLocation> locationCache;
+  public static LongAdder locCacheMissed = new LongAdder();
+  public static LongAdder locCacheAccessed = new LongAdder();

Review Comment:
   > > 
   > 
   > Thanks @tomscut for reviewing the code. I have updated locCacheMissed to 
locCacheMiss. But the field locCacheAccessed could not update to locCacheHit. 
beacuase it mean total cache access count, not cache hit count. Finally, we 
compute hit rate use : locCacheMiss/locCacheAccess
   
   I see. Thanks.





> RBF: Add cache hit rate metric in MountTableResolver#getDestinationForPath
> --------------------------------------------------------------------------
>
>                 Key: HDFS-16882
>                 URL: https://issues.apache.org/jira/browse/HDFS-16882
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: rbf
>    Affects Versions: 3.3.4
>            Reporter: ZhangHB
>            Priority: Minor
>              Labels: pull-request-available
>         Attachments: locationCache.png
>
>
> Currently, the default value of 
> "dfs.federation.router.mount-table.cache.enable" is true and the default 
> value of "dfs.federation.router.mount-table.max-cache-size" is 10000.
> But there is no metric that display cache hit rate, I think we can add a hit 
> rate metric to watch the Cache performance and better tuning the parameters.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to