Source:
public static void main(final String[] args) { EnvironmentInformation.logEnvironmentInfo(LOG, YarnApplicationClusterEntryPoint.class.getSimpleName(), args); SignalHandler.register(LOG); JvmShutdownSafeguard.installAsShutdownHook(LOG); Map<String, String> env = System.getenv(); final String workingDirectory = env.get(ApplicationConstants.Environment.PWD.key()); Preconditions.checkArgument( workingDirectory != null, "Working directory variable (%s) not set", ApplicationConstants.Environment.PWD.key()); try { YarnEntrypointUtils.logYarnEnvironmentInformation(env, LOG); } catch (IOException e) { LOG.warn("Could not log YARN environment information.", e); } final Configuration configuration = YarnEntrypointUtils.loadConfiguration(workingDirectory, env); final ApplicationConfiguration applicationConfiguration = ApplicationConfiguration.fromConfiguration(configuration); PackagedProgram program = null; try { program = getPackagedProgram(configuration, applicationConfiguration); } catch (Exception e) { LOG.error("Could not create application program.", e); System.exit(1); } final JobID jobId = createJobIdForCluster(configuration); configuration.set(PipelineOptionsInternal.PIPELINE_FIXED_JOB_ID, jobId.toHexString()); configuration.set(DeploymentOptions.TARGET, EmbeddedExecutor.NAME); ConfigUtils.encodeCollectionToConfig(configuration, PipelineOptions.JARS, program.getJobJarAndDependencies(), URL::toString); ConfigUtils.encodeCollectionToConfig(configuration, PipelineOptions.CLASSPATHS, program.getClasspaths(), URL::toString); YarnApplicationClusterEntryPoint yarnApplicationClusterEntrypoint = new YarnApplicationClusterEntryPoint(configuration, program); ClusterEntrypoint.runClusterEntrypoint(yarnApplicationClusterEntrypoint); }

Target:
public static void main(final String[] args) { EnvironmentInformation.logEnvironmentInfo(LOG, YarnApplicationClusterEntryPoint.class.getSimpleName(), args); SignalHandler.register(LOG); JvmShutdownSafeguard.installAsShutdownHook(LOG); Map<String, String> env = System.getenv(); final String workingDirectory = env.get(ApplicationConstants.Environment.PWD.key()); Preconditions.checkArgument( workingDirectory != null, "Working directory variable (%s) not set", ApplicationConstants.Environment.PWD.key()); try { YarnEntrypointUtils.logYarnEnvironmentInformation(env, LOG); } catch (IOException e) { LOG.warn("Could not log YARN environment information.", e); } final Configuration configuration = YarnEntrypointUtils.loadConfiguration(workingDirectory, env); PackagedProgram program = null; try { program = getPackagedProgram(configuration); } catch (Exception e) { LOG.error("Could not create application program.", e); System.exit(1); } configuration.set(DeploymentOptions.TARGET, EmbeddedExecutor.NAME); ConfigUtils.encodeCollectionToConfig(configuration, PipelineOptions.JARS, program.getJobJarAndDependencies(), URL::toString); ConfigUtils.encodeCollectionToConfig(configuration, PipelineOptions.CLASSPATHS, program.getClasspaths(), URL::toString); YarnApplicationClusterEntryPoint yarnApplicationClusterEntrypoint = new YarnApplicationClusterEntryPoint(configuration, program); ClusterEntrypoint.runClusterEntrypoint(yarnApplicationClusterEntrypoint); }