Skip to content

Commit

Permalink
Merge pull request #15305 from cdapio/CDAP-20791-fix-master-service-s…
Browse files Browse the repository at this point in the history
…tartup-hadoop

CDAP-20791 fix master service startup on Hadoop
  • Loading branch information
albertshau authored Aug 31, 2023
2 parents 25b8a20 + 4bc543d commit e344826
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,12 @@ private TwillController startTwillApplication(TwillRunnerService twillRunner,
try {
MasterTwillApplication masterTwillApp = new MasterTwillApplication(cConf,
getServiceInstances(serviceStore, cConf));
List<String> extraClassPath = masterTwillApp.prepareLocalizeResource(runDir, hConf);
TwillPreparer preparer = twillRunner.prepare(masterTwillApp);
// Setup extra classpath. Currently twill doesn't support different classpath per runnable,
// hence we just set it for all containers. The actual jars are localized via the MasterTwillApplication,
// and having missing jars as specified in the classpath is ok.
preparer = preparer.withClassPaths(extraClassPath);

Map<String, String> twillConfigs = new HashMap<>();
if (!cConf.getBoolean(Constants.COLLECT_CONTAINER_LOGS)) {
Expand Down Expand Up @@ -979,12 +984,6 @@ private TwillController startTwillApplication(TwillRunnerService twillRunner,
preparer.withApplicationClassPaths(yarnAppClassPath)
.withBundlerClassAcceptor(new HadoopClassExcluder());

// Setup extra classpath. Currently twill doesn't support different classpath per runnable,
// hence we just set it for all containers. The actual jars are localized via the MasterTwillApplication,
// and having missing jars as specified in the classpath is ok.
List<String> extraClassPath = masterTwillApp.prepareLocalizeResource(runDir, hConf);
preparer = preparer.withClassPaths(extraClassPath);

// Set the container to use MasterServiceMainClassLoader for class rewriting
preparer.setClassLoader(MasterServiceMainClassLoader.class.getName());

Expand Down

0 comments on commit e344826

Please sign in to comment.