[
https://issues.apache.org/jira/browse/OOZIE-2797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15866920#comment-15866920
]
Andras Piros commented on OOZIE-2797:
-------------------------------------
[~satishsaley] thanks for the patch!
Some thoughts:
* can you rename {{HCatSecurityUtil}} to e.g. {{HCatTokenInvalidator}}?
* please provide unit tests for changed / new functionality
* I'd remove {{static}} modifier before the method for better unit testing
* I'd inject {{HCatClient}} instance in the constructor instead of calling the
factory method {{HCatClient.create()}} from within the method those
responsibility is just invalidating the HCat token
* moreover I'd introduce a factory (maybe as a nested class) that creates
{{HCatClient}} based on {{Configuration}}
* extract this code to a method:
{code:java}
Token<? extends TokenIdentifier> token =
UserGroupInformation.getCurrentUser().getCredentials().getToken(new Text("HCat
Token"));
{code}
* calls to {{HCatClient.create()}}: employ multi-catch since all {{catch}}
flows do the same. Looking at [*HCatClient source
code*|https://github.com/apache/hcatalog/blob/trunk/webhcat/java-client/src/main/java/org/apache/hcatalog/api/HCatClient.java#L56]
it may be prudent to only catch {{HCatException}}, though. The same for calls
to
[*{{HCatClient.close()}}*|https://github.com/apache/hcatalog/blob/trunk/webhcat/java-client/src/main/java/org/apache/hcatalog/api/HCatClientHMSImpl.java#L655]
* rename {{closeQuietly()}} - ATM it does close the {{HCatClient}} instance but
not so quietly ;)
> Cancellation of Delegation Tokens
> ---------------------------------
>
> Key: OOZIE-2797
> URL: https://issues.apache.org/jira/browse/OOZIE-2797
> Project: Oozie
> Issue Type: Bug
> Reporter: Satish Subhashrao Saley
> Assignee: Satish Subhashrao Saley
> Fix For: 5.0.0
>
> Attachments: OOZIE-2797-1.patch
>
>
> HCat delegation token does not get cancelled unless HCat cancels the token on
> its own after several days (i.e. depending on its configuration).
> Hive Action and Pig Action should cancel delegation token after completion.
> Currently, we can fix it by cancelling the tokens in finally block for Hive
> and Pig Action. I am putting patch for this.
> But, a cleaner solution would be to have a class specifying APIs for
> cancellation and for each type of token, there would be a separate
> implementation. We can do it for Oozie 5.0.0.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)