use of io.mantisrx.server.worker.mesos.VirtualMachineTaskStatus in project mantis by Netflix.
the class RunningWorker method signalCompleted.
public void signalCompleted() {
logger.info("JobId: " + jobId + ", stage: " + stageNum + " workerIndex: " + workerIndex + " workerNumber: " + workerNum + "," + " signaling completed");
jobStatus.onNext(new Status(jobId, stageNum, workerIndex, workerNum, TYPE.INFO, getWorkerStringPrefix(stageNum, workerIndex, workerNum) + " completed", MantisJobState.Completed));
// send complete status
jobStatus.onCompleted();
// send completed status to vm service
vmTaskStatusObserver.onNext(new VirtualMachineTaskStatus(new WorkerId(jobId, workerIndex, workerNum).getId(), VirtualMachineTaskStatus.TYPE.COMPLETED, jobName + ", " + getWorkerStringPrefix(stageNum, workerIndex, workerNum) + " completed"));
}
use of io.mantisrx.server.worker.mesos.VirtualMachineTaskStatus in project mantis by Netflix.
the class RunningWorker method signalStartedInitiated.
public void signalStartedInitiated() {
logger.info("JobId: " + jobId + ", stage: " + stageNum + " workerIndex: " + workerIndex + " workerNumber: " + workerNum + "," + " signaling started initiated");
vmTaskStatusObserver.onNext(new VirtualMachineTaskStatus(new WorkerId(jobId, workerIndex, workerNum).getId(), VirtualMachineTaskStatus.TYPE.STARTED, jobName + ", " + getWorkerStringPrefix(stageNum, workerIndex, workerNum) + " started"));
// indicate start success
requestSubject.onNext(true);
requestSubject.onCompleted();
jobStatus.onNext(new Status(jobId, stageNum, workerIndex, workerNum, TYPE.DEBUG, "Beginning job execution " + workerIndex, MantisJobState.StartInitiated));
}
use of io.mantisrx.server.worker.mesos.VirtualMachineTaskStatus in project mantis by Netflix.
the class VirtualMachineWorkerServiceLocalImpl method start.
@Override
public void start() {
logger.info("Starting VirtualMachineWorkerServiceLocalImpl");
Schedulers.newThread().createWorker().schedule(new Action0() {
@Override
public void call() {
try {
WrappedExecuteStageRequest request = null;
request = createExecuteStageRequest();
setupRequestFailureHandler(request.getRequest().getTimeoutToReportStart(), request.getRequestSubject(), new Action0() {
@Override
public void call() {
logger.error("launch error");
}
});
logger.info("onNext'ing WrappedExecuteStageRequest: {}", request.toString());
executeStageRequestObserver.onNext(request);
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
}, 2, TimeUnit.SECONDS);
// subscribe to vm task updates on current thread
vmTaskStatusObservable.subscribe(new Action1<VirtualMachineTaskStatus>() {
@Override
public void call(VirtualMachineTaskStatus vmTaskStatus) {
TYPE type = vmTaskStatus.getType();
if (type == TYPE.COMPLETED) {
logger.info("Got COMPLETED state for " + vmTaskStatus.getTaskId());
} else if (type == TYPE.STARTED) {
logger.info("Would send RUNNING state to mesos, worker started for " + vmTaskStatus.getTaskId());
}
}
});
}
Aggregations