Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-8997

[Submarine] Small refactors of modifier, condition check and redundant local variables

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3.0
    • Component/s: None
    • Labels:
      None

      Description

      In YarnServiceJobSubmitter#needHdfs. Below code can be simplified to just one line.

      if (content != null && content.contains("hdfs://")) {
        return true;
      }
      return false;
      return content != null && content.contains("hdfs://");

      In CliUtils#argsForHelp

      if (args[0].equals("-h") || args[0].equals("--help")) {
        return true;
      }
      

      Can be simlified to:

       return args[0].equals("-h") || args[0].equals("--help");

      And several redundant variables can be removed.

        Attachments

        1. YARN-8997-trunk-001.patch
          1 kB
          Zhankun Tang
        2. YARN-8997-trunk-002.patch
          6 kB
          Zhankun Tang

          Activity

            People

            • Assignee:
              tangzhankun Zhankun Tang
              Reporter:
              tangzhankun Zhankun Tang
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: