use of com.tencent.angel.master.ps.attempt.PSAttemptContainerAssignedEvent in project angel by Tencent.
the class LocalContainerAllocator method requestContainer.
@SuppressWarnings("unchecked")
private void requestContainer(ContainerAllocatorEvent event) {
LocalContainer allocated = new LocalContainer();
Id id = event.getTaskId();
if (id instanceof PSAttemptId) {
context.getEventHandler().handle(new PSAttemptContainerAssignedEvent((PSAttemptId) id, allocated));
} else if (id instanceof PSAgentAttemptId) {
context.getEventHandler().handle(new PSAgentAttemptContainerAssignedEvent((PSAgentAttemptId) id, allocated));
} else if (id instanceof WorkerAttemptId) {
context.getEventHandler().handle(new WorkerAttemptContainerAssignedEvent((WorkerAttemptId) id, allocated));
}
}
use of com.tencent.angel.master.ps.attempt.PSAttemptContainerAssignedEvent in project angel by Tencent.
the class YarnContainerAllocator method containerAssigned.
@SuppressWarnings("unchecked")
private void containerAssigned(Container allocated, ContainerRequest assigned) {
// Update resource requests
decContainerReq(assigned);
// send the container-assigned event to task attempt
if (assigned.id instanceof PSAttemptId) {
context.getEventHandler().handle(new PSAttemptContainerAssignedEvent((PSAttemptId) assigned.id, allocated));
} else if (assigned.id instanceof PSAgentAttemptId) {
context.getEventHandler().handle(new PSAgentAttemptContainerAssignedEvent((PSAgentAttemptId) assigned.id, allocated));
} else if (assigned.id instanceof WorkerAttemptId) {
context.getEventHandler().handle(new WorkerAttemptContainerAssignedEvent((WorkerAttemptId) assigned.id, allocated));
}
assignedContainerToIDMap.put(allocated.getId(), assigned.id);
idToContainerMap.put(assigned.id, allocated);
LOG.info("Assigned container (" + allocated + ") " + " to task " + assigned.id + " on node " + allocated.getNodeId().toString());
}
Aggregations