Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-5597 YARN Federation improvements
  3. YARN-11334

[Federation] Improve SubClusterState#fromString parameter and LogMessage

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      The SubClusterState object has a fromString method, which can be improved in the following 2 places

      /**
       * Convert a string into {@code SubClusterState}.
       *
       * @param x the string to convert in SubClusterState
       * @return the respective {@code SubClusterState}
       */
      public static SubClusterState fromString(String x) {
        try {
          return SubClusterState.valueOf(x);
        } catch (Exception e) {
          LOG.error("Invalid SubCluster State value in the StateStore does not"
              + " match with the YARN Federation standard.");
          return null;
        }
      } 
      • The parameter is named x, which cannot well express the meaning of the input parameter.
      • The error log does not print the error value.

      Attachments

        Issue Links

          Activity

            People

              slfan1989 Shilun Fan
              slfan1989 Shilun Fan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: