[ 
https://issues.apache.org/jira/browse/MAPREDUCE-7266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17077253#comment-17077253
 ] 

Szilard Nemeth edited comment on MAPREDUCE-7266 at 4/7/20, 1:46 PM:
--------------------------------------------------------------------

Hi [~sahuja],
Thanks for working on this patch, good finding.
Patch makes sense. 
You don't need the cast here for type HistoryContext, as HistoryClientService 
receives a HistoryContext and JobHistory implements this interface.

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

Otherwise, patch looks good to me.
Please upload a second patch, hopefully it will generate a green Jenkins build 
as well.


was (Author: snemeth):
Hi [~sahuja],
Patch makes sense. 
You don't need the cast here for type HistoryContext, as HistoryClientService 
receives a HistoryContext and JobHistory implements this interface.

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

Otherwise, patch looks good to me.
Please upload a second patch, hopefully it will generate a green Jenkins build 
as well.

> historyContext doesn't need to be a class attribute inside JobHistoryServer
> ---------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-7266
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-7266
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: jobhistoryserver
>            Reporter: Siddharth Ahuja
>            Assignee: Siddharth Ahuja
>            Priority: Minor
>         Attachments: YARN-10075.001.patch
>
>
> "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:
> {code}
>   @VisibleForTesting
>   protected HistoryClientService createHistoryClientService() {
>     return new HistoryClientService((HistoryContext)jobHistoryService, 
>         this.jhsDTSecretManager);
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to