Apache9 commented on code in PR #7126:
URL: https://github.com/apache/hbase/pull/7126#discussion_r2196319710


##########
hbase-asyncfs/src/main/java/org/apache/hadoop/hbase/io/asyncfs/monitor/ExcludeDatanodeManager.java:
##########
@@ -78,7 +79,7 @@ public ExcludeDatanodeManager(Configuration conf) {
   public boolean tryAddExcludeDN(DatanodeInfo datanodeInfo, String cause) {
     boolean alreadyMarkedSlow = getExcludeDNs().containsKey(datanodeInfo);
     if (!alreadyMarkedSlow) {
-      excludeDNsCache.put(datanodeInfo, EnvironmentEdgeManager.currentTime());
+      excludeDNsCache.put(datanodeInfo, new Pair(cause, 
EnvironmentEdgeManager.currentTime()));

Review Comment:
   I think this will generate a compile warning? At least use `new 
Pair<>(cause, time)`?



##########
hbase-asyncfs/src/main/java/org/apache/hadoop/hbase/io/asyncfs/monitor/ExcludeDatanodeManager.java:
##########
@@ -78,7 +79,7 @@ public ExcludeDatanodeManager(Configuration conf) {
   public boolean tryAddExcludeDN(DatanodeInfo datanodeInfo, String cause) {
     boolean alreadyMarkedSlow = getExcludeDNs().containsKey(datanodeInfo);

Review Comment:
   Does cache support computeIfAbsent like methods? If so we do not need to 
access it twice.



##########
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapperImpl.java:
##########
@@ -433,8 +433,9 @@ public List<String> getWALExcludeDNs() {
     if (excludeDatanodeManager == null) {
       return Collections.emptyList();
     }
-    return excludeDatanodeManager.getExcludeDNs().entrySet().stream()
-      .map(e -> e.getKey().toString() + ", " + 
e.getValue()).collect(Collectors.toList());
+    return excludeDatanodeManager.getExcludeDNs().entrySet().stream().map(e -> 
e.getKey().toString()
+      + " - " + e.getValue().getSecond() + " - " + e.getValue().getFirst())

Review Comment:
   In the old code we use ',' as separator, but in the new code we change to 
all use '-'? Could you please give some examples about how it looks like in the 
new implementation?



-- 
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]

Reply via email to