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

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 3.3.0, 3.2.2
    • jobhistoryserver
    • None
    • 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 class, 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

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

            Dates

              Created:
              Updated:
              Resolved: