sv2000 commented on a change in pull request #3057: URL: https://github.com/apache/incubator-gobblin/pull/3057#discussion_r458786811
########## File path: gobblin-yarn/src/main/java/org/apache/gobblin/yarn/YarnHelixUtils.java ########## @@ -65,6 +71,23 @@ public static void writeTokenToFile(Token<? extends TokenIdentifier> token, Path credentials.writeTokenStorageFile(tokenFilePath, configuration); } + /** + * Update {@link Token} with token file in resources. + * + * @param + * @throws IOException + */ + public void updateToken() throws IOException{ Review comment: Can this method be made static? ########## File path: gobblin-yarn/src/main/java/org/apache/gobblin/yarn/GobblinYarnTaskRunner.java ########## @@ -201,6 +201,8 @@ public static void main(String[] args) { if (!Strings.isNullOrEmpty(helixInstanceTags)) { config = config.withValue(GobblinClusterConfigurationKeys.HELIX_INSTANCE_TAGS_KEY, ConfigValueFactory.fromAnyRef(helixInstanceTags)); } + YarnHelixUtils utils = new YarnHelixUtils(); Review comment: Do you need to new the utils class? Can't the updateToken() be made public static? ########## File path: gobblin-yarn/src/main/java/org/apache/gobblin/yarn/GobblinYarnAppLauncher.java ########## @@ -877,18 +880,17 @@ private Path getHdfsLogDir(Path appWorkDir) throws IOException { return logRootDir; } - private AbstractYarnAppSecurityManager buildSecurityManager() throws IOException { + private AbstractYarnAppSecurityManager buildSecurityManager(boolean isReconnected) throws IOException { Path tokenFilePath = new Path(this.fs.getHomeDirectory(), this.applicationName + Path.SEPARATOR + GobblinYarnConfigurationKeys.TOKEN_FILE_NAME); ClassAliasResolver<AbstractYarnAppSecurityManager> aliasResolver = new ClassAliasResolver<>( AbstractYarnAppSecurityManager.class); try { - return (AbstractYarnAppSecurityManager)ConstructorUtils.invokeConstructor(Class.forName(aliasResolver.resolve( + return (AbstractYarnAppSecurityManager) GobblinConstructorUtils.invokeLongestConstructor(Class.forName(aliasResolver.resolve( ConfigUtils.getString(config, GobblinYarnConfigurationKeys.SECURITY_MANAGER_CLASS, GobblinYarnConfigurationKeys.DEFAULT_SECURITY_MANAGER_CLASS))), this.config, this.helixManager, this.fs, - tokenFilePath); - } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException | InstantiationException - | ClassNotFoundException e) { + tokenFilePath, isReconnected); + } catch (ReflectiveOperationException e) { Review comment: +1 on consolidating all the exceptions into ReflectiveOperationException. ########## File path: gobblin-yarn/src/main/java/org/apache/gobblin/yarn/YarnHelixUtils.java ########## @@ -24,12 +24,14 @@ import java.util.Map; import org.apache.commons.lang3.StringUtils; +import org.apache.gobblin.cluster.GobblinClusterUtils; Review comment: This looks like an unused import. ########## File path: gobblin-yarn/src/main/java/org/apache/gobblin/yarn/GobblinApplicationMaster.java ########## @@ -227,7 +227,8 @@ public static void main(String[] args) throws Exception { printUsage(options); System.exit(1); } - + YarnHelixUtils utils = new YarnHelixUtils(); Review comment: See comment below about making the updateToken() method static. ---------------------------------------------------------------- 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