[
https://issues.apache.org/jira/browse/GOBBLIN-1228?focusedWorklogId=468806&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-468806
]
ASF GitHub Bot logged work on GOBBLIN-1228:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 10/Aug/20 18:46
Start Date: 10/Aug/20 18:46
Worklog Time Spent: 10m
Work Description: jhsenjaliya commented on a change in pull request #3074:
URL: https://github.com/apache/incubator-gobblin/pull/3074#discussion_r468106247
##########
File path:
gobblin-yarn/src/main/java/org/apache/gobblin/yarn/YarnHelixUtils.java
##########
@@ -72,19 +73,22 @@ public static void writeTokenToFile(Token<? extends
TokenIdentifier> token, Path
}
/**
- * Update {@link Token} with token file in resources.
+ * Update {@link Token} with token file localized by NM.
*
- * @param
+ * @param tokenFileName name of the token file
* @throws IOException
*/
- public static void updateToken() throws IOException{
- File tokenFile = new
File(YarnHelixUtils.class.getClassLoader().getResource(GobblinYarnConfigurationKeys.TOKEN_FILE_NAME).getFile());
- if(tokenFile.exists()) {
- Credentials credentials = Credentials.readTokenStorageFile(tokenFile,
new Configuration());
- for (Token<? extends TokenIdentifier> token :
credentials.getAllTokens()) {
- LOGGER.info("updating " + token.getKind() + " " + token.getService());
+ public static void updateToken(String tokenFileName) throws IOException{
+ URL tokenFileUrl =
YarnHelixUtils.class.getClassLoader().getResource(tokenFileName);
+ if (tokenFileUrl != null) {
Review comment:
+1 on NPE check, this was an issue on previous code. Thanks
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 468806)
Time Spent: 1h 10m (was: 1h)
> Do not localize token file on new TaskRunner launch
> ---------------------------------------------------
>
> Key: GOBBLIN-1228
> URL: https://issues.apache.org/jira/browse/GOBBLIN-1228
> Project: Apache Gobblin
> Issue Type: Bug
> Components: gobblin-yarn
> Affects Versions: 0.15.0
> Reporter: Sudarshan Vasudevan
> Assignee: Abhishek Tiwari
> Priority: Major
> Fix For: 0.16.0
>
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> Currently, the token file is localized on each new container launch. The
> localization should happen only for AM container. Further, this task also
> provides a fix for NPE thrown in case the token file is not available
> locally.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)