if (container.getContainerId().getId() == 1) {
/** * Generates our command line string used to launch our guagua tasks. * * @return the BASH shell commands to launch the job. */ private List<String> generateShellExecCommand() { String programArgs = new StringBuilder(300) .append(getAppAttemptId().getApplicationId().getClusterTimestamp()).append(" ") .append(getAppAttemptId().getApplicationId().getId()).append(" ") .append(this.container.getId().getId()).append(" ").append(getAppAttemptId().getAttemptId()) .append(" ").append(this.partition).append(" ").append(GuaguaAppMaster.this.rpcHostName) .append(" ").append(GuaguaAppMaster.this.rpcPort).toString(); return YarnUtils.getCommand(GuaguaYarnTask.class.getName(), GuaguaAppMaster.this.containerArgs, programArgs, getHeapPerContainer() + ""); }
/** * Ask RM to allocate given no. of containers to this Application Master * @param requestedContainers Containers to ask for from RM * @return Response from RM to AM with allocated containers * @throws YarnException, IOException */ public static AllocateResponse sendContainerAskToRM( AtomicInteger rmRequestID, ApplicationAttemptId appAttemptID, ApplicationMasterProtocol resourceManager, List<ResourceRequest> requestedContainers, List<ContainerId> releasedContainers, float progress) throws YarnException, IOException { AllocateRequest req = AllocateRequest.newInstance( rmRequestID.incrementAndGet(), progress, requestedContainers, releasedContainers, null); LOG.info("Sending request to RM for containers" + ", requestedSet=" + requestedContainers.size() + ", releasedSet=" + releasedContainers.size() + ", progress=" + req.getProgress()); for (ResourceRequest rsrcReq : requestedContainers) { LOG.info("Requested container ask: " + rsrcReq.toString()); } for (ContainerId id : releasedContainers) { LOG.info("Released container, id=" + id.getId()); } AllocateResponse resp = resourceManager.allocate(req); return resp; }
/** * Generates our command line string used to launch our guagua tasks. * * @return the BASH shell commands to launch the job. */ private List<String> generateShellExecCommand() { String programArgs = new StringBuilder(300) .append(getAppAttemptId().getApplicationId().getClusterTimestamp()).append(" ") .append(getAppAttemptId().getApplicationId().getId()).append(" ") .append(this.container.getId().getId()).append(" ").append(getAppAttemptId().getAttemptId()) .append(" ").append(this.partition).append(" ").append(GuaguaAppMaster.this.rpcHostName) .append(" ").append(GuaguaAppMaster.this.rpcPort).toString(); return YarnUtils.getCommand(GuaguaYarnTask.class.getName(), GuaguaAppMaster.this.containerArgs, programArgs, getHeapPerContainer() + ""); }
LOG.info("Released container, id=" + id.getId());
LOG.info("Released container, id={}", containerId.getId()); amRmClient.releaseAssignedContainer(containerId);
@SuppressWarnings("deprecation") public static ContainerId getMockContainerId(FiCaSchedulerApp application) { ContainerId containerId = mock(ContainerId.class); doReturn(application.getApplicationAttemptId()). when(containerId).getApplicationAttemptId(); long id = application.getNewContainerId(); doReturn((int)id).when(containerId).getId(); doReturn(id).when(containerId).getContainerId(); return containerId; }
mSplits.putIfAbsent(Integer.valueOf(container.getId().getId()), fSplits); sameSplit.setSplits(paths); for (Container container : containers) { Integer containerId = container.getId().getId(); String downFileName = Utilities.getApplicationDir(conf, appAttemptID.toString()) Integer index = i % containerSize; ConcurrentHashMap<String, FileSplit> mapSplit = null; Integer containerID = containers.get(index).getId().getId(); if (notSame.containsKey(containerID)) { mapSplit = notSame.get(containerID);
@SuppressWarnings("deprecation") public static ContainerId getMockContainerId(FiCaSchedulerApp application) { ContainerId containerId = mock(ContainerId.class); doReturn(application.getApplicationAttemptId()). when(containerId).getApplicationAttemptId(); long id = application.getNewContainerId(); doReturn((int)id).when(containerId).getId(); doReturn(id).when(containerId).getContainerId(); return containerId; }
Map<String, String> params = new HashMap<>(); params.put("applicationId", Integer.toString(container.getId().getApplicationAttemptId().getApplicationId().getId())); params.put("containerId", Integer.toString(container.getId().getId())); StrSubstitutor sub = new StrSubstitutor(params, "%(", ")"); vargs.add(sub.replace(jvmOpts));
env.put(MPIConstants.CONTAINOUTPUT, Utilities.encodeMPIResult(results)); env.put("CONTAINER_ID", String.valueOf(container.getId().getId())); env.put("APPMASTER_HOST", System.getenv(NM_HOST_ENV)); env.put("APPMASTER_PORT", String.valueOf(mpdListener.getServerPort()));
LOG.info("Releasing container: " + rel.getId());
splits.get(Integer.valueOf(allocatedContainer.getId().getId())), resultToDestination.values());
@SuppressWarnings("deprecation") protected void writeContainerStartData(ContainerId containerId) throws IOException { store.containerStarted(ContainerStartData.newInstance(containerId, Resource.newInstance(0, 0), NodeId.newInstance("localhost", 0), Priority.newInstance(containerId.getId()), 0)); }
ContainerHistoryData data = store.getContainer(containerId); Assert.assertNotNull(data); Assert.assertEquals(Priority.newInstance(containerId.getId()), data.getPriority()); Assert.assertEquals(containerId.toString(), data.getDiagnosticsInfo());
ContainerHistoryData containerData = store.getContainer(containerId); Assert.assertNotNull(containerData); Assert.assertEquals(Priority.newInstance(containerId.getId()), containerData.getPriority()); if (missingContainer && k == num) {