use of com.tencent.angel.ps.PSAttemptId in project angel by Tencent.
the class MasterService method psDone.
/**
* notify a parameter server run over successfully
* @param controller rpc controller of protobuf
* @param request parameter server attempt id
* @throws ServiceException
*/
@SuppressWarnings("unchecked")
@Override
public PSDoneResponse psDone(RpcController controller, PSDoneRequest request) throws ServiceException {
PSAttemptId psAttemptId = ProtobufUtil.convertToId(request.getPsAttemptId());
LOG.info("psAttempt " + psAttemptId + " is done");
// remove this parameter server attempt from monitor set
psLastHeartbeatTS.remove(psAttemptId);
context.getEventHandler().handle(new PSAttemptEvent(PSAttemptEventType.PA_SUCCESS, psAttemptId));
return PSDoneResponse.newBuilder().build();
}
use of com.tencent.angel.ps.PSAttemptId 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