You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2019/12/09 15:33:32 UTC

[GitHub] [hadoop-ozone] sodonnel opened a new pull request #328: HDDS-2671 Have NodeManager.getNodeStatus throw NodeNotFoundException

sodonnel opened a new pull request #328: HDDS-2671 Have NodeManager.getNodeStatus throw NodeNotFoundException
URL: https://github.com/apache/hadoop-ozone/pull/328
 
 
   ## Requires HDDS-2593 to be committed before this one.
   
   ## What changes were proposed in this pull request?
   
   Currently, the SCM node manager method getNodeStatus catches any NodeNotFoundException and returns null.
   
   ```
     /**
      * Returns the node status of a specific node.
      *
      * @param datanodeDetails Datanode Details
      * @return NodeStatus for the node
      */
     @Override
     public NodeStatus getNodeStatus(DatanodeDetails datanodeDetails) {
       try {
         return nodeStateManager.getNodeStatus(datanodeDetails);
       } catch (NodeNotFoundException e) {
         // TODO: should we throw NodeNotFoundException?
         return null;
       }
     }
   ```
   
   This should throw the exception to ensure downstream code does not need to perform a null check each time it is called.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-2671
   
   ## How was this patch tested?
   
   Tested by existing unit tests which make calls to this API.
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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