Search in sources :

Example 6 with PSAgentAttemptId

use of com.tencent.angel.psagent.PSAgentAttemptId in project angel by Tencent.

the class AMPSAgent method addAndScheduleAttempt.

@SuppressWarnings("unchecked")
public void addAndScheduleAttempt() {
    PSAgentAttempt attempt = new PSAgentAttempt(new PSAgentAttemptId(id, nextAttemptNumber), context);
    attempts.put(attempt.getId(), attempt);
    LOG.info("scheduling " + attempt.getId());
    runningAttemptId = attempt.getId();
    nextAttemptNumber++;
    getContext().getEventHandler().handle(new PSAgentAttemptEvent(PSAgentAttemptEventType.PSAGENT_ATTEMPT_SCHEDULE, attempt.getId()));
}
Also used : PSAgentAttemptId(com.tencent.angel.psagent.PSAgentAttemptId)

Example 7 with PSAgentAttemptId

use of com.tencent.angel.psagent.PSAgentAttemptId in project angel by Tencent.

the class ProtobufUtil method convertToId.

public static PSAgentAttemptId convertToId(PSAgentAttemptIdProto idProto) {
    PSAgentAttemptId id = protoToPSAgentAttemptIdMap.get(idProto);
    if (id == null) {
        id = new PSAgentAttemptId(convertToId(idProto.getPsAgentId()), idProto.getAttemptIndex());
        protoToPSAgentAttemptIdMap.put(idProto, id);
    }
    return id;
}
Also used : PSAgentAttemptId(com.tencent.angel.psagent.PSAgentAttemptId)

Aggregations

PSAgentAttemptId (com.tencent.angel.psagent.PSAgentAttemptId)7 Location (com.tencent.angel.common.location.Location)1 MasterServiceTest (com.tencent.angel.master.MasterServiceTest)1 PSLocation (com.tencent.angel.ml.matrix.transport.PSLocation)1 PSAgent (com.tencent.angel.psagent.PSAgent)1 IOException (java.io.IOException)1