use of io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.ListWorkersResponse in project mantis by Netflix.
the class JobActor method onListActiveWorkers.
/**
* Responds with {@link ListWorkersResponse} object containing data about all active workers.
*
* @param listWorkersRequest
*/
public void onListActiveWorkers(ListWorkersRequest listWorkersRequest) {
ActorRef sender = getSender();
List<IMantisWorkerMetadata> activeWorkers = this.workerManager.getActiveWorkers(listWorkersRequest.getLimit());
sender.tell(new ListWorkersResponse(listWorkersRequest.requestId, SUCCESS, "", Collections.unmodifiableList(activeWorkers)), getSelf());
}
use of io.mantisrx.master.jobcluster.proto.JobClusterManagerProto.ListWorkersResponse in project mantis by Netflix.
the class JobClusterActor method onListActiveWorkers.
public void onListActiveWorkers(final ListWorkersRequest r) {
if (logger.isTraceEnabled()) {
logger.trace("Enter JobClusterActor:onListActiveWorkers {}", r);
}
Optional<JobInfo> jobInfo = jobManager.getJobInfoForNonTerminalJob(r.getJobId());
if (jobInfo.isPresent()) {
jobInfo.get().jobActor.forward(r, getContext());
} else {
logger.warn("No such active job {} ", r.getJobId());
getSender().tell(new ListWorkersResponse(r.requestId, CLIENT_ERROR, "No such active job " + r.getJobId(), Lists.newArrayList()), getSelf());
}
if (logger.isTraceEnabled()) {
logger.trace("Exit JobClusterActor:onListActiveWorkers {}", r);
}
}
Aggregations