use of edu.iu.dsc.tws.api.net.request.RequestID in project twister2 by DSC-SPIDAL.
the class JMDriverAgent method sendToDriver.
@Override
public boolean sendToDriver(Message message) {
JobMasterAPI.WorkerMessage workerMessage = JobMasterAPI.WorkerMessage.newBuilder().setData(Any.pack(message).toByteString()).setWorkerID(workerID).build();
RequestID requestID = rrClient.sendRequest(workerMessage);
if (requestID == null) {
LOG.severe("Could not send WorkerToDriver message.");
return false;
}
LOG.fine("Sent WorkerToDriver message: \n" + workerMessage);
return true;
}
use of edu.iu.dsc.tws.api.net.request.RequestID in project twister2 by DSC-SPIDAL.
the class JMWorkerHandler method sendListWorkersResponseToWaitList.
private void sendListWorkersResponseToWaitList() {
List<JobMasterAPI.WorkerInfo> workerList = workerMonitor.getWorkerInfoList();
JobMasterAPI.ListWorkersResponse response = JobMasterAPI.ListWorkersResponse.newBuilder().setNumberOfWorkers(workerList.size()).addAllWorker(workerList).build();
for (RequestID requestID : waitList) {
rrServer.sendResponse(requestID, response);
}
waitList.clear();
}
use of edu.iu.dsc.tws.api.net.request.RequestID in project twister2 by DSC-SPIDAL.
the class FamilyInitHandler method scheduleResponse.
public boolean scheduleResponse(int workerId, RequestID requestID) {
if (this.pause) {
LOG.info("Handler is in paused mode, due to cluster instability. " + "Ignored a request from " + workerId);
this.sendRejectedResponse(requestID);
return false;
}
RequestID previousRequest = this.pendingResponses.put(workerId, requestID);
if (previousRequest != null) {
LOG.warning("Duplicate request received for " + this.family + " from worker : " + workerId + ". Workers might be coming after a failure.");
}
if (this.pendingResponses.size() == count) {
for (RequestID pendingRespons : this.pendingResponses.values()) {
this.rrServer.sendResponse(pendingRespons, Checkpoint.FamilyInitializeResponse.newBuilder().setFamily(this.family).setVersion(this.familyVersion).build());
}
this.pendingResponses.clear();
return true;
} else {
return false;
}
}
Aggregations