@Override public void readFields(DataInput dataInput) throws IOException { this.containerId = ConverterUtils.toContainerId(Text.readString(dataInput)); }
ConverterUtils.toContainerId(System.getenv().get(ApplicationConstants.Environment.CONTAINER_ID.key())); String applicationName = cmd.getOptionValue(GobblinClusterConfigurationKeys.APPLICATION_NAME_OPTION_NAME); String helixInstanceName = cmd.getOptionValue(GobblinClusterConfigurationKeys.HELIX_INSTANCE_NAME_OPTION_NAME);
ContainerId containerId = ConverterUtils.toContainerId(envs .get(ApplicationConstants.Environment.CONTAINER_ID.name())); jstormMasterContext.appAttemptID = containerId.getApplicationAttemptId();
public static void main(String[] args) throws Exception { Options options = buildOptions(); try { CommandLine cmd = new DefaultParser().parse(options, args); if (!cmd.hasOption(GobblinClusterConfigurationKeys.APPLICATION_NAME_OPTION_NAME)) { printUsage(options); System.exit(1); } Log4jConfigurationHelper.updateLog4jConfiguration(GobblinApplicationMaster.class, GobblinYarnConfigurationKeys.GOBBLIN_YARN_LOG4J_CONFIGURATION_FILE, GobblinYarnConfigurationKeys.GOBBLIN_YARN_LOG4J_CONFIGURATION_FILE); LOGGER.info(JvmUtils.getJvmInputArguments()); ContainerId containerId = ConverterUtils.toContainerId(System.getenv().get(ApplicationConstants.Environment.CONTAINER_ID.key())); try (GobblinApplicationMaster applicationMaster = new GobblinApplicationMaster( cmd.getOptionValue(GobblinClusterConfigurationKeys.APPLICATION_NAME_OPTION_NAME), containerId, ConfigFactory.load(), new YarnConfiguration())) { applicationMaster.start(); } } catch (ParseException pe) { printUsage(options); System.exit(1); } } }
conf.addResource(new Path(XLearningConstants.XLEARNING_JOB_CONFIGURATION)); LOG.info("user is " + conf.get("hadoop.job.ugi")); this.containerId = new XLearningContainerId(ConverterUtils.toContainerId(System .getenv(ApplicationConstants.Environment.CONTAINER_ID.name()))); this.downloadRetry = conf.getInt(XLearningConfiguration.XLEARNING_DOWNLOAD_FILE_RETRY, XLearningConfiguration.DEFAULT_XLEARNING_DOWNLOAD_FILE_RETRY);
.toContainerId(envs.get(ApplicationConstants.Environment.CONTAINER_ID.toString())); applicationAttemptID = containerId.getApplicationAttemptId(); } else {
if (containerIdStr != null && !containerIdStr.isEmpty()) { daemonConf.set(ConfVars.LLAP_DAEMON_CONTAINER_ID.varname, containerIdStr); appName = ConverterUtils.toContainerId(containerIdStr) .getApplicationAttemptId().getApplicationId().toString(); } else {
ContainerId containerId = ConverterUtils.toContainerId(envs .get(Environment.CONTAINER_ID.name())); appAttemptID = containerId.getApplicationAttemptId();
public TaskAttemptStartedEvent(TaskAttemptID attemptId, TaskType taskType, long startTime, String trackerName, int httpPort, int shufflePort, String locality, String avataar) { this(attemptId, taskType, startTime, trackerName, httpPort, shufflePort, ConverterUtils.toContainerId("container_-1_-1_-1_-1"), locality, avataar); }
public TaskAttemptStartedEvent(TaskAttemptID attemptId, TaskType taskType, long startTime, String trackerName, int httpPort, int shufflePort, String locality, String avataar) { this(attemptId, taskType, startTime, trackerName, httpPort, shufflePort, ConverterUtils.toContainerId("container_-1_-1_-1_-1"), locality, avataar); }
/** * @return the ContainerId for the MRAppMaster. */ public ContainerId getContainerId() { return ConverterUtils.toContainerId(datum.containerId.toString()); }
/** Get the ContainerId */ public ContainerId getContainerId() { return ConverterUtils.toContainerId(datum.containerId.toString()); } /** Get the locality */
private static void loadContainerToken(RecoveredContainerTokensState state, String key, String containerIdStr, byte[] value) throws IOException { ContainerId containerId; Long expTime; try { containerId = ConverterUtils.toContainerId(containerIdStr); expTime = Long.parseLong(asString(value)); } catch (IllegalArgumentException e) { throw new IOException("Bad container token state for " + key, e); } state.activeTokens.put(containerId, expTime); }
private static void loadContainerToken(RecoveredContainerTokensState state, String key, String containerIdStr, byte[] value) throws IOException { ContainerId containerId; Long expTime; try { containerId = ConverterUtils.toContainerId(containerIdStr); expTime = Long.parseLong(asString(value)); } catch (IllegalArgumentException e) { throw new IOException("Bad container token state for " + key, e); } state.activeTokens.put(containerId, expTime); }
@Override public void readFields(DataInput in) throws IOException { StringBuilder sb = new StringBuilder(); char c = in.readChar(); while (c != '$') { sb.append(c); c = in.readChar(); } this.id = ConverterUtils.toContainerId(sb.toString()); }
protected static ContainerId parseContainerId(String containerId) { if (containerId == null || containerId.isEmpty()) { throw new NotFoundException("containerId, " + containerId + ", is empty or null"); } ContainerId cid = ConverterUtils.toContainerId(containerId); if (cid == null) { throw new NotFoundException("containerId is null"); } return cid; }
public void fromProto(ContainerLaunchedProto proto) { this.containerId = ConverterUtils.toContainerId(proto.getContainerId()); launchTime = proto.getLaunchTime(); this.applicationAttemptId = ConverterUtils.toApplicationAttemptId( proto.getApplicationAttemptId()); }
public void fromProto(ContainerStoppedProto proto) { this.containerId = ConverterUtils.toContainerId(proto.getContainerId()); stopTime = proto.getStopTime(); exitStatus = proto.getExitStatus(); this.applicationAttemptId = ConverterUtils.toApplicationAttemptId( proto.getApplicationAttemptId()); }
public void fromProto(TaskAttemptStartedProto proto) { this.taskAttemptId = TezTaskAttemptID.fromString(proto.getTaskAttemptId()); this.launchTime = proto.getStartTime(); this.containerId = ConverterUtils.toContainerId(proto.getContainerId()); this.nodeId = ConverterUtils.toNodeId(proto.getNodeId()); }
@Test public void testContainerId() throws URISyntaxException { ContainerId id = TestContainerId.newContainerId(0, 0, 0, 0); String cid = ConverterUtils.toString(id); assertEquals("container_0_0000_00_000000", cid); ContainerId gen = ConverterUtils.toContainerId(cid); assertEquals(gen, id); }