response.getContainersFromPreviousAttempts(); LOG.info(jstormMasterContext.appAttemptID + " received " + previousAMRunningContainers.size() + " previous attempts' running containers on AM registration.");
/** * Initializes the list of previous containers as reported by YARN. */ private synchronized void initializeListOfPreviousContainers() { if (this.previousContainers == null) { final List<Container> yarnPrevContainers = this.registration.getRegistration().getContainersFromPreviousAttempts(); // If it's still null, create an empty list to indicate that it's not a restart. if (yarnPrevContainers == null) { this.previousContainers = Collections.unmodifiableSet(new HashSet<Container>()); } else { this.previousContainers = Collections.unmodifiableSet(new HashSet<>(yarnPrevContainers)); } yarnContainerManager.onContainersRecovered(this.previousContainers); } }
private void mergeRegisterResponse( RegisterApplicationMasterResponse homeResponse, RegisterApplicationMasterResponse otherResponse) { if (!isNullOrEmpty(otherResponse.getContainersFromPreviousAttempts())) { if (!isNullOrEmpty(homeResponse.getContainersFromPreviousAttempts())) { homeResponse.getContainersFromPreviousAttempts() .addAll(otherResponse.getContainersFromPreviousAttempts()); } else { homeResponse.setContainersFromPreviousAttempts( otherResponse.getContainersFromPreviousAttempts()); } } if (!isNullOrEmpty(otherResponse.getNMTokensFromPreviousAttempts())) { if (!isNullOrEmpty(homeResponse.getNMTokensFromPreviousAttempts())) { homeResponse.getNMTokensFromPreviousAttempts() .addAll(otherResponse.getNMTokensFromPreviousAttempts()); } else { homeResponse.setNMTokensFromPreviousAttempts( otherResponse.getNMTokensFromPreviousAttempts()); } } }
private void processPreviousContainers() { final List<Container> previousContainers = this.registration.getRegistration().getContainersFromPreviousAttempts(); if (previousContainers != null && !previousContainers.isEmpty()) { LOG.log(Level.INFO, "Driver restarted, with {0} previous containers", previousContainers.size());
RegisterApplicationMasterResponse registration = entry.getValue(); if (!isNullOrEmpty(registration.getContainersFromPreviousAttempts())) { List<Container> tempContainers = homeResponse.getAllocatedContainers(); if (!isNullOrEmpty(tempContainers)) { tempContainers .addAll(registration.getContainersFromPreviousAttempts()); homeResponse.setAllocatedContainers(tempContainers); } else { homeResponse.setAllocatedContainers( registration.getContainersFromPreviousAttempts()); registration.getContainersFromPreviousAttempts(), entry.getKey());
@SuppressWarnings("unchecked") private RegisterApplicationMasterResponse registerApplicationMaster() throws YarnException, IOException { RegisterApplicationMasterRequest request = RegisterApplicationMasterRequest.newInstance(this.appHostName, this.appHostPort, this.appTrackingUrl); if (!this.placementConstraints.isEmpty()) { request.setPlacementConstraints(this.placementConstraints); } RegisterApplicationMasterResponse response = rmClient.registerApplicationMaster(request); synchronized (this) { lastResponseId = 0; if (!response.getNMTokensFromPreviousAttempts().isEmpty()) { populateNMTokens(response.getNMTokensFromPreviousAttempts()); } this.resourceProfilesMap = response.getResourceProfiles(); List<Container> prevContainers = response.getContainersFromPreviousAttempts(); AMRMClientUtils.removeFromOutstandingSchedulingRequests(prevContainers, this.outstandingSchedRequests); } return response; }
.getContainersFromPreviousAttempts(); LOG.info(appAttemptID + " received " + previousAMRunningContainers.size() + " previous attempts' running containers on AM registration.");
.getContainersFromPreviousAttempts()) { containerIdToSubClusterIdMap.put(container.getId(), subClusterId); containers++; response.getContainersFromPreviousAttempts().size(), subClusterId);
&& response.getContainersFromPreviousAttempts() != null) { cacheAllocatedContainers( response.getContainersFromPreviousAttempts(), subClusterId);
response.getContainersFromPreviousAttempts(); LOG.info(appAttemptID + " received " + previousAMRunningContainers.size() + " previous attempts' running containers on AM registration.");
this.homeRMRelayer.registerApplicationMaster(request); if (this.amRegistrationResponse .getContainersFromPreviousAttempts() != null) { cacheAllocatedContainers( this.amRegistrationResponse.getContainersFromPreviousAttempts(), this.homeSubClusterId);
List<Container> containers = response.getContainersFromPreviousAttempts();
Assert.assertEquals(2, response.getContainersFromPreviousAttempts().size()); Assert.assertEquals(1, response.getNMTokensFromPreviousAttempts().size());
liveContainers = amRegistrationData.getContainersFromPreviousAttempts();
liveContainers = amRegistrationData.getContainersFromPreviousAttempts();
Assert.assertEquals(1, registerResponse.getContainersFromPreviousAttempts() .size()); boolean containerId2Exists = false; Container container = registerResponse.getContainersFromPreviousAttempts().get(0); if (container.getId().equals(containerId2)) { containerId2Exists = true;
registerResponse.getContainersFromPreviousAttempts().size()); Assert.assertEquals("container 2", containerId2, registerResponse.getContainersFromPreviousAttempts().get(0).getId()); List<NMToken> prevNMTokens = registerResponse .getNMTokensFromPreviousAttempts();
Assert.assertEquals(2, registerResponse.getContainersFromPreviousAttempts() .size()); boolean containerId2Exists = false, containerId3Exists = false; for (Container container : registerResponse .getContainersFromPreviousAttempts()) { if (container.getId().equals(containerId2)) { containerId2Exists = true;
Assert.assertEquals(2, registerResponse.getContainersFromPreviousAttempts() .size()); boolean containerId2Exists = false, containerId3Exists = false; for (Container container : registerResponse .getContainersFromPreviousAttempts()) { if (container.getId().equals(containerId2)) { containerId2Exists = true;