public void failEvaluator(final MockAllocatedEvaluator evaluator) {
    if (this.allocatedEvaluators.remove(evaluator)) {
      this.failedEvaluators.add(new MockFailedEvaluator(evaluator.getId()));
      // cleanup
      final Iterator<MockRunningTask> taskIter = this.runningTasks.iterator();
      while (taskIter.hasNext()) {
        final MockRunningTask task = taskIter.next();
        if (task.evaluatorID().equals(evaluator.getId())) {
          taskIter.remove();
        }
      }
      final Iterator<MockActiveContext> contextIter = this.activeContexts.iterator();
      while (contextIter.hasNext()) {
        final MockActiveContext context = contextIter.next();
        if (context.getEvaluatorId().equals(evaluator.getId())) {
          contextIter.remove();
        }
      }
    }
  }
public void failEvaluator ( final MockAllocatedEvaluator evaluator ) { if ( this . allocatedEvaluators . remove ( evaluator ) ) { this . failedEvaluators . add ( new MockFailedEvaluator ( evaluator . getId ( ) ) ) ; final Iterator < MockRunningTask > taskIter = this . runningTasks . iterator ( ) ; while ( taskIter . hasNext ( ) ) { final MockRunningTask task = taskIter . next ( ) ; if ( task . evaluatorID ( ) . equals ( evaluator . getId ( ) ) ) { taskIter . remove ( ) ; } } final Iterator < MockActiveContext > contextIter = this . activeContexts . iterator ( ) ; while ( contextIter . hasNext ( ) ) { final MockActiveContext context = contextIter . next ( ) ; if ( context . getEvaluatorId ( ) . equals ( evaluator . getId ( ) ) ) { contextIter . remove ( ) ; } } } }
Fail an evaluator; automatically cleans up state i.e., running tasks and contexts
pertaining to the evaluator, and adds the evaluator to {@link this#getFailedEvaluators()}, which
can be passed to the {@link org.apache.reef.driver.parameters.DriverRestartFailedEvaluatorHandlers}.
@param evaluator to fail