[ 
https://issues.apache.org/jira/browse/GOBBLIN-1210?focusedWorklogId=458418&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-458418
 ]

ASF GitHub Bot logged work on GOBBLIN-1210:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 14/Jul/20 02:05
            Start Date: 14/Jul/20 02:05
    Worklog Time Spent: 10m 
      Work Description: sv2000 commented on a change in pull request #3057:
URL: https://github.com/apache/incubator-gobblin/pull/3057#discussion_r454053098



##########
File path: 
gobblin-yarn/src/main/java/org/apache/gobblin/yarn/GobblinApplicationMaster.java
##########
@@ -227,6 +227,8 @@ public static void main(String[] args) throws Exception {
         printUsage(options);
         System.exit(1);
       }
+      Config config = ConfigFactory.load();

Review comment:
       Can we replace the ConfigFactory.load() in line 240 with the config 
variable created here?

##########
File path: 
gobblin-yarn/src/main/java/org/apache/gobblin/yarn/YarnHelixUtils.java
##########
@@ -65,6 +71,27 @@ public static void writeTokenToFile(Token<? extends 
TokenIdentifier> token, Path
     credentials.writeTokenStorageFile(tokenFilePath, configuration);
   }
 
+  /**
+   * Update {@link Token} with the configured token path.
+   *
+   * @param config a {@link Config} object carrying Hadoop configuration 
properties and token path config
+   * @throws IOException
+   */
+  public static void updateToken(Config config) throws IOException{
+    FileSystem fs = GobblinClusterUtils.buildFileSystem(config, new 
Configuration());
+    Path tokenPath = new Path(fs.getHomeDirectory(),
+        config.getString(GobblinYarnConfigurationKeys.APPLICATION_NAME_KEY) + 
Path.SEPARATOR
+            + GobblinYarnConfigurationKeys.TOKEN_FILE_NAME);
+    if(fs.exists(tokenPath)) {
+      Credentials credentials = Credentials.readTokenStorageFile(tokenPath, 
fs.getConf());

Review comment:
       Can lines 86-91 be refactored out into a separate addCredentials() 
method, which can be called also from YarnContainerSecurityManager?




----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 458418)
    Time Spent: 50m  (was: 40m)

> Force AM to read from token file to update token when start up
> --------------------------------------------------------------
>
>                 Key: GOBBLIN-1210
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1210
>             Project: Apache Gobblin
>          Issue Type: Task
>            Reporter: Zihan Li
>            Priority: Major
>          Time Spent: 50m
>  Remaining Estimate: 0h
>




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

Reply via email to