use of com.continuuity.weave.internal.DefaultWeaveRunResources in project weave by continuuity.
the class ApplicationMasterService method initRunningContainers.
private RunningContainers initRunningContainers(ContainerId appMasterContainerId, String appMasterHost) throws Exception {
WeaveRunResources appMasterResources = new DefaultWeaveRunResources(0, appMasterContainerId.toString(), Integer.parseInt(System.getenv(EnvKeys.YARN_CONTAINER_VIRTUAL_CORES)), Integer.parseInt(System.getenv(EnvKeys.YARN_CONTAINER_MEMORY_MB)), appMasterHost);
String appId = appMasterContainerId.getApplicationAttemptId().getApplicationId().toString();
return new RunningContainers(appId, appMasterResources);
}
use of com.continuuity.weave.internal.DefaultWeaveRunResources in project weave by continuuity.
the class RunningContainers method start.
void start(String runnableName, ContainerInfo containerInfo, WeaveContainerLauncher launcher) {
containerLock.lock();
try {
int instanceId = getStartInstanceId(runnableName);
RunId runId = getRunId(runnableName, instanceId);
WeaveContainerController controller = launcher.start(runId, instanceId, WeaveContainerMain.class, "$HADOOP_CONF_DIR");
containers.put(runnableName, containerInfo.getId(), controller);
WeaveRunResources resources = new DefaultWeaveRunResources(instanceId, containerInfo.getId(), containerInfo.getVirtualCores(), containerInfo.getMemoryMB(), containerInfo.getHost().getHostName());
resourceReport.addRunResources(runnableName, resources);
if (startSequence.isEmpty() || !runnableName.equals(startSequence.peekLast())) {
startSequence.addLast(runnableName);
}
containerChange.signalAll();
} finally {
containerLock.unlock();
}
}
Aggregations