[ https://issues.apache.org/jira/browse/OOZIE-2797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15868271#comment-15868271 ]
Rohini Palaniswamy commented on OOZIE-2797: ------------------------------------------- bq. 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 bq. moreover I'd introduce a factory (maybe as a nested class) that creates HCatClient based on Configuration bq. extract this code to a method: Token<? extends TokenIdentifier> token = UserGroupInformation.getCurrentUser().getCredentials().getToken(new Text("HCat Token")); [~andras.piros], You are taking clean coding to an extreme :). Introducing code injection, a factory class and a method for 3 lines of code would be absurd. bq. I'd remove static modifier before the method for better unit testing Static or non-static should not matter for unit testing > 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)