ResourceStatusEventImpl.newBuilder().setIdentifier(taskStatus.getTaskId().getValue());
private void handleContainerError(final ContainerId containerId, final Throwable throwable) { this.reefEventHandlers.onResourceStatus(ResourceStatusEventImpl.newBuilder() .setIdentifier(containerId.toString()) .setState(State.FAILED) .setExitCode(1) .setDiagnostics(throwable.getMessage()) .build()); }
ResourceStatusEventImpl.newBuilder().setIdentifier(containerId);
/** * Calls the appropriate handler via REEFEventHandlers, which is a runtime specific implementation * of the YARN runtime. * @param evaluatorIds the set of evaluator IDs of failed evaluators during restart. */ @Override public void informAboutEvaluatorFailures(final Set<String> evaluatorIds) { for (String evaluatorId : evaluatorIds) { LOG.log(Level.WARNING, "Container [" + evaluatorId + "] has failed during driver restart process, FailedEvaluatorHandler will be triggered, but " + "no additional evaluator can be requested due to YARN-2433."); // trigger a failed evaluator event this.reefEventHandlers.onResourceStatus(ResourceStatusEventImpl.newBuilder() .setIdentifier(evaluatorId) .setState(State.FAILED) .setExitCode(1) .setDiagnostics("Container [" + evaluatorId + "] failed during driver restart process.") .build()); } } }
/** * Inform REEF of an unclean process exit. * * @param processId * @param exitCode */ private void onUncleanExit(final String processId, final int exitCode) { this.onResourceStatus( ResourceStatusEventImpl.newBuilder() .setIdentifier(processId) .setState(State.FAILED) .setExitCode(exitCode) .build() ); }
@Override public void executorLost(final SchedulerDriver driver, final Protos.ExecutorID executorId, final Protos.SlaveID slaveId, final int status) { final String diagnostics = "Executor Lost. executorid: "+executorId.getValue()+" slaveid: "+slaveId.getValue(); final ResourceStatusEvent resourceStatus = ResourceStatusEventImpl.newBuilder() .setIdentifier(executorId.getValue()) .setState(State.FAILED) .setExitCode(status) .setDiagnostics(diagnostics) .build(); this.reefEventHandlers.onResourceStatus(resourceStatus); }
/** * Inform REEF of a cleanly exited process. * * @param processId */ private void onCleanExit(final String processId) { this.onResourceStatus( ResourceStatusEventImpl.newBuilder() .setIdentifier(processId) .setState(State.DONE) .setExitCode(0) .build() ); }
/** * NM Callback: NM reports stop of a container. * @param containerId ID of a container stopped. */ @Override public void onContainerStopped(final ContainerId containerId) { final boolean hasContainer = this.containers.hasContainer(containerId.toString()); if (hasContainer) { this.reefEventHandlers.onResourceStatus( ResourceStatusEventImpl.newBuilder() .setIdentifier(containerId.toString()) .setState(State.DONE) .build()); } }
@Override public void onProcessStarted(final String processId) { this.onResourceStatus( ResourceStatusEventImpl.newBuilder() .setIdentifier(processId) .setState(State.RUNNING) .build() ); }