adoroszlai commented on a change in pull request #328: HDDS-2671 Have 
NodeManager.getNodeStatus throw NodeNotFoundException
URL: https://github.com/apache/hadoop-ozone/pull/328#discussion_r358728836
 
 

 ##########
 File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ReplicationManager.java
 ##########
 @@ -785,6 +787,20 @@ private void sendDeleteCommand(final ContainerInfo 
container,
     tracker.accept(new InflightAction(datanode, Time.monotonicNow()));
   }
 
+  /**
+   * Wrap the call to nodeManager.getNodeStatus, catching any
+   * NodeNotFoundException and instead throwing a RuntimeException.
+   * @param dn The datanodeDetails to obtain the NodeStatus for
+   * @return NodeStatus corresponding to the given Datanode.
+   */
+  private NodeStatus getNodeStatus(DatanodeDetails dn) {
+    try {
+      return nodeManager.getNodeStatus(dn);
+    } catch (NodeNotFoundException e) {
+      throw new RuntimeException("Unable to find NodeStatus for "+dn, e);
 
 Review comment:
   I think this should be more specific, eg. `IllegalStateException` seems to 
be a good candidate.  If you agree, please remember to update the corresponding 
`catch`, too.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to