Search in sources :

Example 1 with RMContainerNMDoneChangeResourceEvent

use of org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerNMDoneChangeResourceEvent in project hadoop by apache.

the class AbstractYarnScheduler method containerIncreasedOnNode.

protected void containerIncreasedOnNode(ContainerId containerId, SchedulerNode node, Container increasedContainerReportedByNM) {
    /*
     * No lock is required, as this method is protected by scheduler's writeLock
     */
    // Get the application for the finished container
    SchedulerApplicationAttempt application = getCurrentAttemptForContainer(containerId);
    if (application == null) {
        LOG.info("Unknown application " + containerId.getApplicationAttemptId().getApplicationId() + " increased container " + containerId + " on node: " + node);
        this.rmContext.getDispatcher().getEventHandler().handle(new RMNodeCleanContainerEvent(node.getNodeID(), containerId));
        return;
    }
    RMContainer rmContainer = getRMContainer(containerId);
    if (rmContainer == null) {
        // Some unknown container sneaked into the system. Kill it.
        this.rmContext.getDispatcher().getEventHandler().handle(new RMNodeCleanContainerEvent(node.getNodeID(), containerId));
        return;
    }
    rmContainer.handle(new RMContainerNMDoneChangeResourceEvent(containerId, increasedContainerReportedByNM.getResource()));
}
Also used : RMContainerNMDoneChangeResourceEvent(org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerNMDoneChangeResourceEvent) RMNodeCleanContainerEvent(org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNodeCleanContainerEvent) RMContainer(org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainer)

Aggregations

RMContainer (org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainer)1 RMContainerNMDoneChangeResourceEvent (org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainerNMDoneChangeResourceEvent)1 RMNodeCleanContainerEvent (org.apache.hadoop.yarn.server.resourcemanager.rmnode.RMNodeCleanContainerEvent)1