use of org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.ResourceSet in project hadoop by apache.
the class ContainerManagerImpl method reInitializeContainer.
/**
* ReInitialize a container using a new Launch Context. If the
* retryFailureContext is not provided, The container is
* terminated on Failure.
*
* NOTE: Auto-Commit is true by default. This also means that the rollback
* context is purged as soon as the command to start the new process
* is sent. (The Container moves to RUNNING state)
*
* @param containerId Container Id.
* @param autoCommit Auto Commit flag.
* @param reInitLaunchContext Target Launch Context.
* @throws YarnException Yarn Exception.
*/
public void reInitializeContainer(ContainerId containerId, ContainerLaunchContext reInitLaunchContext, boolean autoCommit) throws YarnException {
Container container = preReInitializeOrLocalizeCheck(containerId, ReInitOp.RE_INIT);
ResourceSet resourceSet = new ResourceSet();
try {
if (reInitLaunchContext != null) {
resourceSet.addResources(reInitLaunchContext.getLocalResources());
}
dispatcher.getEventHandler().handle(new ContainerReInitEvent(containerId, reInitLaunchContext, resourceSet, autoCommit));
container.setIsReInitializing(true);
} catch (URISyntaxException e) {
LOG.info("Error when parsing local resource URI for upgrade of" + "Container [" + containerId + "]", e);
throw new YarnException(e);
}
}
Aggregations