Search in sources :

Example 1 with DefaultWeaveRunResources

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);
}
Also used : DefaultWeaveRunResources(com.continuuity.weave.internal.DefaultWeaveRunResources) WeaveRunResources(com.continuuity.weave.api.WeaveRunResources) DefaultWeaveRunResources(com.continuuity.weave.internal.DefaultWeaveRunResources)

Example 2 with DefaultWeaveRunResources

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();
    }
}
Also used : DefaultWeaveRunResources(com.continuuity.weave.internal.DefaultWeaveRunResources) WeaveContainerController(com.continuuity.weave.internal.WeaveContainerController) RunId(com.continuuity.weave.api.RunId) WeaveRunResources(com.continuuity.weave.api.WeaveRunResources) DefaultWeaveRunResources(com.continuuity.weave.internal.DefaultWeaveRunResources)

Aggregations

WeaveRunResources (com.continuuity.weave.api.WeaveRunResources)2 DefaultWeaveRunResources (com.continuuity.weave.internal.DefaultWeaveRunResources)2 RunId (com.continuuity.weave.api.RunId)1 WeaveContainerController (com.continuuity.weave.internal.WeaveContainerController)1