Example usage for org.apache.hadoop.yarn.server.resourcemanager.rmcontainer RMContainer getContainerExitStatus

List of usage examples for org.apache.hadoop.yarn.server.resourcemanager.rmcontainer RMContainer getContainerExitStatus

Introduction

In this page you can find the example usage for org.apache.hadoop.yarn.server.resourcemanager.rmcontainer RMContainer getContainerExitStatus.

Prototype

int getContainerExitStatus();

Source Link

Usage

From source file:org.apache.myriad.scheduler.fgs.YarnNodeCapacityManager.java

License:Apache License

private void removeYarnTask(RMContainer rmContainer) {
    if (containersNotNull(rmContainer)) {
        Protos.TaskID taskId = containerToTaskId(rmContainer);
        /*//from  ww w  .  ja v  a 2s  .c o m
         * Mark the task as killable within the ServerState object to flag the task 
         * for the TaskTerminator daemon to kill the task
         */
        state.makeTaskKillable(taskId);

        Node node = retrieveNode(rmContainer);
        if (node != null) {
            RMNode rmNode = node.getNode().getRMNode();
            Resource resource = rmContainer.getContainer().getResource();
            decrementNodeCapacity(rmNode, resource);
            LOGGER.info("Removed task yarn_{} with exit status freeing {} cpu and {} mem.",
                    rmContainer.getContainer().toString(), rmContainer.getContainerExitStatus(),
                    resource.getVirtualCores(), resource.getMemory());
        } else {
            LOGGER.warn("The Node for the {} host was not found",
                    rmContainer.getContainer().getNodeId().getHost());
        }
    }
}