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

Devaraj Das commented on MAPREDUCE-1430:
----------------------------------------

Looks close now. Some things to be fixed:
1) The hashmap for delegation tokens could use the JobID object as the key
2) I don't see a good motivation for having equals and hashcode implementations 
in the private class DelegationTokenToRenew. The implementations can be 
improved as well but I don't see a strong reason for introducing them in this 
patch.
3) The initial value of newExpirationDate could be 60 minutes. I don't see the 
need for initializing it to -1 and then setting it to some other value based on 
that.
4) In removeDelegationTokenRenewal, the checks for the jobid for the tokens is 
redundant. The hashmap already provides you with that list.
5) The DelegationTokenToRenew class doesn't need to store the jobID at all. 
Everywhere the jobID could be passed as argument to the methods where it is 
required.
6) When would alreadyInMap ever return true? If it never does, i suggest we 
remove this check.
7) You haven't synchronized on the accesses to delegationTokens object 
everywhere. Maybe, a better approach would be to just define the object as a 
synchronized.

> JobTracker should be able to renew delegation tokens for the jobs
> -----------------------------------------------------------------
>
>                 Key: MAPREDUCE-1430
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-1430
>             Project: Hadoop Map/Reduce
>          Issue Type: Sub-task
>          Components: jobtracker
>    Affects Versions: 0.22.0
>            Reporter: Devaraj Das
>            Assignee: Boris Shkolnik
>             Fix For: 0.22.0
>
>         Attachments: MAPREDUCE-1430-12.patch, MAPREDUCE-1430-5.patch, 
> MAPREDUCE-1430-6.patch, MAPREDUCE-1430-8.patch
>
>
> JobTracker should automatically renew delegation tokens for the jobs it is 
> currently running.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to