@Test public void testBuildApplicationMasterCommand() { String command = this.gobblinYarnAppLauncher.buildApplicationMasterCommand("application_1234_3456", 64); Assert.assertTrue(command.contains("-Xmx41")); }
@VisibleForTesting protected String buildApplicationMasterCommand(String applicationId, int memoryMbs) { String appMasterClassName = GobblinApplicationMaster.class.getSimpleName(); return new StringBuilder() .append(ApplicationConstants.Environment.JAVA_HOME.$()).append("/bin/java") .append(" -Xmx").append((int) (memoryMbs * this.jvmMemoryXmxRatio) - this.jvmMemoryOverheadMbs).append("M") .append(" -D").append(GobblinYarnConfigurationKeys.JVM_USER_TIMEZONE_CONFIG).append("=").append(this.containerTimezone) .append(" -D").append(GobblinYarnConfigurationKeys.GOBBLIN_YARN_CONTAINER_LOG_DIR_NAME).append("=").append(ApplicationConstants.LOG_DIR_EXPANSION_VAR) .append(" -D").append(GobblinYarnConfigurationKeys.GOBBLIN_YARN_CONTAINER_LOG_FILE_NAME).append("=").append(appMasterClassName).append(".").append(ApplicationConstants.STDOUT) .append(" ").append(JvmUtils.formatJvmArguments(this.appMasterJvmArgs)) .append(" ").append(GobblinApplicationMaster.class.getName()) .append(" --").append(GobblinClusterConfigurationKeys.APPLICATION_NAME_OPTION_NAME) .append(" ").append(this.applicationName) .append(" --").append(GobblinClusterConfigurationKeys.APPLICATION_ID_OPTION_NAME) .append(" ").append(applicationId) .append(" 1>").append(ApplicationConstants.LOG_DIR_EXPANSION_VAR).append(File.separator).append( appMasterClassName).append(".").append(ApplicationConstants.STDOUT) .append(" 2>").append(ApplicationConstants.LOG_DIR_EXPANSION_VAR).append(File.separator).append( appMasterClassName).append(".").append(ApplicationConstants.STDERR) .toString(); }
GobblinYarnAppLauncher { @VisibleForTesting protected String buildApplicationMasterCommand(String applicationId, int memoryMbs) { String appMasterClassName = GobblinApplicationMaster.class.getSimpleName(); return new StringBuilder() .append(ApplicationConstants.Environment.JAVA_HOME.$()).append("/bin/java") .append(" -Xmx").append((int) (memoryMbs * this.jvmMemoryXmxRatio) - this.jvmMemoryOverheadMbs).append("M") .append(" -D").append(GobblinYarnConfigurationKeys.JVM_USER_TIMEZONE_CONFIG).append("=").append(this.containerTimezone) .append(" -D").append(GobblinYarnConfigurationKeys.GOBBLIN_YARN_CONTAINER_LOG_DIR_NAME).append("=").append(ApplicationConstants.LOG_DIR_EXPANSION_VAR) .append(" -D").append(GobblinYarnConfigurationKeys.GOBBLIN_YARN_CONTAINER_LOG_FILE_NAME).append("=").append(appMasterClassName).append(".").append(ApplicationConstants.STDOUT) .append(" ").append(JvmUtils.formatJvmArguments(this.appMasterJvmArgs)) .append(" ").append(GobblinApplicationMaster.class.getName()) .append(" --").append(GobblinClusterConfigurationKeys.APPLICATION_NAME_OPTION_NAME) .append(" ").append(this.applicationName) .append(" --").append(GobblinClusterConfigurationKeys.APPLICATION_ID_OPTION_NAME) .append(" ").append(applicationId) .append(" 1>").append(ApplicationConstants.LOG_DIR_EXPANSION_VAR).append(File.separator).append( appMasterClassName).append(".").append(ApplicationConstants.STDOUT) .append(" 2>").append(ApplicationConstants.LOG_DIR_EXPANSION_VAR).append(File.separator).append( appMasterClassName).append(".").append(ApplicationConstants.STDERR) .toString(); } }
GobblinYarnAppLauncher { @VisibleForTesting protected String buildApplicationMasterCommand(String applicationId, int memoryMbs) { String appMasterClassName = GobblinApplicationMaster.class.getSimpleName(); return new StringBuilder() .append(ApplicationConstants.Environment.JAVA_HOME.$()).append("/bin/java") .append(" -Xmx").append((int) (memoryMbs * this.jvmMemoryXmxRatio) - this.jvmMemoryOverheadMbs).append("M") .append(" -D").append(GobblinYarnConfigurationKeys.JVM_USER_TIMEZONE_CONFIG).append("=").append(this.containerTimezone) .append(" -D").append(GobblinYarnConfigurationKeys.GOBBLIN_YARN_CONTAINER_LOG_DIR_NAME).append("=").append(ApplicationConstants.LOG_DIR_EXPANSION_VAR) .append(" -D").append(GobblinYarnConfigurationKeys.GOBBLIN_YARN_CONTAINER_LOG_FILE_NAME).append("=").append(appMasterClassName).append(".").append(ApplicationConstants.STDOUT) .append(" ").append(JvmUtils.formatJvmArguments(this.appMasterJvmArgs)) .append(" ").append(GobblinApplicationMaster.class.getName()) .append(" --").append(GobblinClusterConfigurationKeys.APPLICATION_NAME_OPTION_NAME) .append(" ").append(this.applicationName) .append(" --").append(GobblinClusterConfigurationKeys.APPLICATION_ID_OPTION_NAME) .append(" ").append(applicationId) .append(" 1>").append(ApplicationConstants.LOG_DIR_EXPANSION_VAR).append(File.separator).append( appMasterClassName).append(".").append(ApplicationConstants.STDOUT) .append(" 2>").append(ApplicationConstants.LOG_DIR_EXPANSION_VAR).append(File.separator).append( appMasterClassName).append(".").append(ApplicationConstants.STDERR) .toString(); } GobblinYarnAppLauncher(Config config, YarnConfiguration yarnConfiguration); }
GobblinYarnAppLauncher { @VisibleForTesting protected String buildApplicationMasterCommand(String applicationId, int memoryMbs) { String appMasterClassName = GobblinApplicationMaster.class.getSimpleName(); return new StringBuilder() .append(ApplicationConstants.Environment.JAVA_HOME.$()).append("/bin/java") .append(" -Xmx").append((int) (memoryMbs * this.jvmMemoryXmxRatio) - this.jvmMemoryOverheadMbs).append("M") .append(" -D").append(GobblinYarnConfigurationKeys.JVM_USER_TIMEZONE_CONFIG).append("=").append(this.containerTimezone) .append(" -D").append(GobblinYarnConfigurationKeys.GOBBLIN_YARN_CONTAINER_LOG_DIR_NAME).append("=").append(ApplicationConstants.LOG_DIR_EXPANSION_VAR) .append(" -D").append(GobblinYarnConfigurationKeys.GOBBLIN_YARN_CONTAINER_LOG_FILE_NAME).append("=").append(appMasterClassName).append(".").append(ApplicationConstants.STDOUT) .append(" ").append(JvmUtils.formatJvmArguments(this.appMasterJvmArgs)) .append(" ").append(GobblinApplicationMaster.class.getName()) .append(" --").append(GobblinClusterConfigurationKeys.APPLICATION_NAME_OPTION_NAME) .append(" ").append(this.applicationName) .append(" --").append(GobblinClusterConfigurationKeys.APPLICATION_ID_OPTION_NAME) .append(" ").append(applicationId) .append(" 1>").append(ApplicationConstants.LOG_DIR_EXPANSION_VAR).append(File.separator).append( appMasterClassName).append(".").append(ApplicationConstants.STDOUT) .append(" 2>").append(ApplicationConstants.LOG_DIR_EXPANSION_VAR).append(File.separator).append( appMasterClassName).append(".").append(ApplicationConstants.STDERR) .toString(); } GobblinYarnAppLauncher(Config config, YarnConfiguration yarnConfiguration); void launch(); synchronized void stop(); @Subscribe void handleApplicationReportArrivalEvent(ApplicationReportArrivalEvent applicationReportArrivalEvent); @Subscribe void handleGetApplicationReportFailureEvent(
      GetApplicationReportFailureEvent getApplicationReportFailureEvent); static void main(String[] args); }
GobblinYarnAppLauncher { @VisibleForTesting protected String buildApplicationMasterCommand(String applicationId, int memoryMbs) { String appMasterClassName = GobblinApplicationMaster.class.getSimpleName(); return new StringBuilder() .append(ApplicationConstants.Environment.JAVA_HOME.$()).append("/bin/java") .append(" -Xmx").append((int) (memoryMbs * this.jvmMemoryXmxRatio) - this.jvmMemoryOverheadMbs).append("M") .append(" -D").append(GobblinYarnConfigurationKeys.JVM_USER_TIMEZONE_CONFIG).append("=").append(this.containerTimezone) .append(" -D").append(GobblinYarnConfigurationKeys.GOBBLIN_YARN_CONTAINER_LOG_DIR_NAME).append("=").append(ApplicationConstants.LOG_DIR_EXPANSION_VAR) .append(" -D").append(GobblinYarnConfigurationKeys.GOBBLIN_YARN_CONTAINER_LOG_FILE_NAME).append("=").append(appMasterClassName).append(".").append(ApplicationConstants.STDOUT) .append(" ").append(JvmUtils.formatJvmArguments(this.appMasterJvmArgs)) .append(" ").append(GobblinApplicationMaster.class.getName()) .append(" --").append(GobblinClusterConfigurationKeys.APPLICATION_NAME_OPTION_NAME) .append(" ").append(this.applicationName) .append(" --").append(GobblinClusterConfigurationKeys.APPLICATION_ID_OPTION_NAME) .append(" ").append(applicationId) .append(" 1>").append(ApplicationConstants.LOG_DIR_EXPANSION_VAR).append(File.separator).append( appMasterClassName).append(".").append(ApplicationConstants.STDOUT) .append(" 2>").append(ApplicationConstants.LOG_DIR_EXPANSION_VAR).append(File.separator).append( appMasterClassName).append(".").append(ApplicationConstants.STDERR) .toString(); } GobblinYarnAppLauncher(Config config, YarnConfiguration yarnConfiguration); void launch(); synchronized void stop(); @Subscribe void handleApplicationReportArrivalEvent(ApplicationReportArrivalEvent applicationReportArrivalEvent); @Subscribe void handleGetApplicationReportFailureEvent(
      GetApplicationReportFailureEvent getApplicationReportFailureEvent); static void main(String[] args); static final String GOBBLIN_YARN_CONFIG_OUTPUT_PATH; static final String GOBBLIN_YARN_APP_LAUNCHER_MODE; static final String DEFAULT_GOBBLIN_YARN_APP_LAUNCHER_MODE; static final String AZKABAN_APP_LAUNCHER_MODE_KEY; }