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

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

                Author: ASF GitHub Bot
            Created on: 13/Mar/24 21:16
            Start Date: 13/Mar/24 21:16
    Worklog Time Spent: 10m 
      Work Description: homatthew commented on code in PR #3891:
URL: https://github.com/apache/gobblin/pull/3891#discussion_r1523928137


##########
gobblin-yarn/src/main/java/org/apache/gobblin/yarn/GobblinYarnAppLauncher.java:
##########
@@ -898,49 +858,31 @@ private Path getHdfsLogDir(Path appWorkDir) throws 
IOException {
     return logRootDir;
   }
 
-  private AbstractYarnAppSecurityManager buildSecurityManager() throws 
IOException {
+  /**
+   *
+   * @return
+   * @throws IOException
+   */
+  private AbstractAppSecurityManager buildSecurityManager() throws IOException 
{
     Path tokenFilePath = new Path(this.fs.getHomeDirectory(), 
this.applicationName + Path.SEPARATOR +
         GobblinYarnConfigurationKeys.TOKEN_FILE_NAME);
+    String securityManagerClassName = ConfigUtils.getString(config, 
GobblinYarnConfigurationKeys.SECURITY_MANAGER_CLASS, 
GobblinYarnConfigurationKeys.DEFAULT_SECURITY_MANAGER_CLASS);
 
-    ClassAliasResolver<AbstractYarnAppSecurityManager> aliasResolver = new 
ClassAliasResolver<>(
-        AbstractYarnAppSecurityManager.class);
     try {
-     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);
+      if (helixClusterLifecycleManager.isPresent()) {
+        HelixManager helixManager = 
helixClusterLifecycleManager.get().getHelixManager();
+        ClassAliasResolver<AbstractYarnAppSecurityManager> aliasResolver = new 
ClassAliasResolver<>(AbstractYarnAppSecurityManager.class);
+        return (AbstractYarnAppSecurityManager) 
GobblinConstructorUtils.invokeLongestConstructor(Class.forName(aliasResolver.resolve(securityManagerClassName)),
 this.config, helixManager, this.fs,
+            tokenFilePath);
+      }
+
+      ClassAliasResolver aliasResolver = new 
ClassAliasResolver<>(AbstractAppSecurityManager.class);
+      return (AbstractAppSecurityManager) 
GobblinConstructorUtils.invokeLongestConstructor(Class.forName(aliasResolver.resolve(securityManagerClassName)),
 this.config, this.fs, tokenFilePath);

Review Comment:
   The gobblin constructor utils will catastrophically fail if you pass null as 
a second param because it's not possible to infer the type of null. Hence we 
have the 2 separate code paths





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

    Worklog Id:     (was: 909744)
    Time Spent: 2h 40m  (was: 2.5h)

> Make a Gobblin yarn app launcher that does not depend on Helix
> --------------------------------------------------------------
>
>                 Key: GOBBLIN-2004
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-2004
>             Project: Apache Gobblin
>          Issue Type: Improvement
>            Reporter: Matthew Ho
>            Priority: Major
>          Time Spent: 2h 40m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to