Hexiaoqiao commented on code in PR #8313:
URL: https://github.com/apache/hadoop/pull/8313#discussion_r3166408381
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameCache.java:
##########
@@ -147,9 +147,9 @@ void initialized() {
}
/** Promote a frequently used name to the cache */
- private void promote(final K name) {
+ private void promote(final K name, final UseCount useCount) {
transientMap.remove(name);
- cache.put(name, name);
+ cache.put(name, useCount.value);
lookups += useThreshold;
}
Review Comment:
How about fix it as the following code snippet? Thus we didn't change
signature and could keep it more simple.
```
private void promote(final K name) {
UseCount useCount = transientMap.remove(name);
cache.put(name, useCount.value);
lookups += useThreshold;
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]