kokonguyen191 commented on code in PR #8144:
URL: https://github.com/apache/hadoop/pull/8144#discussion_r3136437784
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NNStorage.java:
##########
@@ -162,6 +163,14 @@ public boolean isOfType(StorageDirType type) {
* Name directories size for metric.
*/
private Map<String, Long> nameDirSizeMap = new HashMap<>();
+ /**
+ * Service to update {@link #nameDirSizeMap} asynchronously instead of
blocking.
+ */
+ private final NameDirSizeMapUpdateService metricsUpdateService;
Review Comment:
Hi @ZanderXu, it makes sense to reduce the complexity of the design when the
same can be achieved with less. I have updated the design to use a volatile
flag for checking and delegate the map update to metrics query. Please take a
look when you have free time, thanks!
--
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]