use of org.apache.hadoop.yarn.api.ContainerManager in project weave by continuuity.
the class Hadoop20YarnNMClient method start.
@Override
public Cancellable start(YarnContainerInfo containerInfo, YarnLaunchContext launchContext) {
ContainerLaunchContext context = launchContext.getLaunchContext();
context.setUser(System.getProperty("user.name"));
Container container = containerInfo.getContainer();
context.setContainerId(container.getId());
context.setResource(container.getResource());
StartContainerRequest startRequest = Records.newRecord(StartContainerRequest.class);
startRequest.setContainerLaunchContext(context);
ContainerManager manager = connectContainerManager(container);
try {
manager.startContainer(startRequest);
return new ContainerTerminator(container, manager);
} catch (YarnRemoteException e) {
LOG.error("Error in launching process", e);
throw Throwables.propagate(e);
}
}
Aggregations