Uploaded image for project: 'Hadoop Map/Reduce'
  1. Hadoop Map/Reduce
  2. MAPREDUCE-7266

historyContext doesn't need to be a class attribute inside JobHistoryServer

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3.0, 3.2.2
    • Component/s: jobhistoryserver
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      "historyContext" class attribute at https://github.com/apache/hadoop/blob/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/JobHistoryServer.java#L67 is assigned a cast of another class attribute - "jobHistoryService" - https://github.com/apache/hadoop/blob/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/JobHistoryServer.java#L131, however it does not need to be stored separately because it is only ever used once in the clas, and that too as an argument while instantiating the HistoryClientService class at https://github.com/apache/hadoop/blob/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/JobHistoryServer.java#L155.

      Therefore, we could just delete the lines at https://github.com/apache/hadoop/blob/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/JobHistoryServer.java#L67 and https://github.com/apache/hadoop/blob/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-hs/src/main/java/org/apache/hadoop/mapreduce/v2/hs/JobHistoryServer.java#L131 completely and instantiate the HistoryClientService as follows:

        @VisibleForTesting
        protected HistoryClientService createHistoryClientService() {
          return new HistoryClientService((HistoryContext)jobHistoryService, 
              this.jhsDTSecretManager);
        }
      

        Attachments

        1. MAPREDUCE-7266.002.patch
          4 kB
          Siddharth Ahuja
        2. YARN-10075.001.patch
          4 kB
          Siddharth Ahuja

          Activity

            People

            • Assignee:
              sahuja Siddharth Ahuja
              Reporter:
              sahuja Siddharth Ahuja
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: