Montura commented on code in PR #6654:
URL: https://github.com/apache/ozone/pull/6654#discussion_r1594763032


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/states/NodeStateMap.java:
##########
@@ -445,6 +465,11 @@ private List<DatanodeInfo> 
filterNodes(Predicate<DatanodeInfo> filter) {
     return result;
   }
 
+  private @Nonnull DatanodeInfo getNodeInfoUnsafe(@Nonnull UUID uuid) throws 
NodeNotFoundException {
+    checkIfNodeExist(uuid);
+    return nodeMap.get(uuid);
+  }

Review Comment:
   Sure, I'll remove duplicates. I saw this practice with `unsafe` method once 
and it seems to me very clear.



##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/states/NodeStateMap.java:
##########
@@ -43,27 +45,28 @@
  * NodeStateManager to maintain the state. If anyone wants to change the
  * state of a node they should call NodeStateManager, do not directly use
  * this class.
+ * <p>
+ * Concurrency consideration:
+ *   - assumes thread-safe usage
+ *   - all public WRITE methods are protected by WRITE_LOCK
+ *   - all public READ methods are protected by READ_LOCK

Review Comment:
   Sure!



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

Reply via email to