Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-1880 Decommissioning and maintenance mode in Ozone
  3. HDDS-2671

Have NodeManager.getNodeStatus throw NodeNotFoundException

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.5.0
    • 0.5.0
    • SCM

    Description

      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 probably throw the exception to ensure downstream code does not need to perform a null check each time it is called.

      Attachments

        Issue Links

          Activity

            People

              sodonnell Stephen O'Donnell
              sodonnell Stephen O'Donnell
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m