Java Code Examples for org.apache.reef.driver.context.FailedContext#getId()

The following examples show how to use org.apache.reef.driver.context.FailedContext#getId() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JobDriver.java    From reef with Apache License 2.0 6 votes vote down vote up
private void handleFailedEvaluator(final FailedEvaluator eval, final boolean isRestartFailed) {
  try (LoggingScope ls = loggingScopeFactory.evaluatorFailed(eval.getId())) {
    LOG.log(Level.SEVERE, "FailedEvaluator", eval);
    for (final FailedContext failedContext : eval.getFailedContextList()) {
      final String failedContextId = failedContext.getId();
      LOG.log(Level.INFO, "removing context " + failedContextId + " from job driver contexts.");
      JobDriver.this.contexts.remove(failedContextId);
    }
    final String message = "Evaluator " + eval.getId() + " failed with message: "
        + eval.getEvaluatorException().getMessage();
    JobDriver.this.jobMessageObserver.sendMessageToClient(message.getBytes(StandardCharsets.UTF_8));

    if (isRestartFailed) {
      evaluatorFailedHandlerWaitForCLRBridgeSetup(
          JobDriver.this.handlerManager.getDriverRestartFailedEvaluatorHandler(), eval, isRestartFailed);
    } else {
      evaluatorFailedHandlerWaitForCLRBridgeSetup(JobDriver.this.handlerManager.getFailedEvaluatorHandler(),
          eval, isRestartFailed);
    }
  }
}
 
Example 2
Source File: FailedContextBridge.java    From reef with Apache License 2.0 5 votes vote down vote up
public FailedContextBridge(final FailedContext failedContext, final ActiveContextBridgeFactory factory) {
  jfailedContext = failedContext;
  evaluatorDescriptor = failedContext.getEvaluatorDescriptor();
  evaluatorId = failedContext.getEvaluatorId();
  contextId = failedContext.getId();
  if (failedContext.getParentContext().isPresent()) {
    final ActiveContext parent = failedContext.getParentContext().get();
    this.parentContextId = parent.getId();
    this.parentContext = factory.getActiveContextBridge(parent);
  } else {
    this.parentContextId = null;
    this.parentContext = null;
  }

}
 
Example 3
Source File: NemoDriver.java    From incubator-nemo with Apache License 2.0 4 votes vote down vote up
@Override
public void onNext(final FailedContext failedContext) {
  throw new RuntimeException(failedContext.getId() + " failed. See driver's log for the stack trace in executor.",
    failedContext.asError());
}
 
Example 4
Source File: NemoDriver.java    From nemo with Apache License 2.0 4 votes vote down vote up
@Override
public void onNext(final FailedContext failedContext) {
  throw new RuntimeException(failedContext.getId() + " failed. See driver's log for the stack trace in executor.",
      failedContext.asError());
}