Source:
<code>private BenchmarkPhaseEvent reportProgressUntilFinished(int queriesSubmitted, boolean continueOnFailure) { int completed = 0; double lastProgress = 0; Map<Status, Integer> statusCount = new EnumMap<>(Status.class); while (completed < queriesSubmitted) { try { BenchmarkQueryEvent event = completionService.take().get(); completed++; statusCount.compute(event.getEventStatus(), (status, count) -> count == null ? 1 : count + 1); <START> if (event.getEventStatus().equals(FAILED) && !continueOnFailure) { <END> executor.shutdownNow(); return postEvent(BenchmarkPhaseEvent.failed(phaseName, event.getErrorMessage())); } double progress = ((double) completed) / queriesSubmitted * 100; if (progress - lastProgress > 0.5 || completed == queriesSubmitted) { log.info("Progress: %s succeeded, %s failed, %s submitted, %.2f%% done", statusCount.getOrDefault(SUCCEEDED, 0), statusCount.getOrDefault(FAILED, 0), queriesSubmitted, progress); lastProgress = progress; } } catch (InterruptedException e) { currentThread().interrupt(); if (!continueOnFailure) { executor.shutdownNow(); return postEvent(BenchmarkPhaseEvent.failed(phaseName, e.toString())); } } catch (ExecutionException e) { executor.shutdownNow(); if (!continueOnFailure) { executor.shutdownNow(); return postEvent(BenchmarkPhaseEvent.failed(phaseName, e.toString())); } } } if (statusCount.getOrDefault(FAILED, 0) > 0) { return postEvent(BenchmarkPhaseEvent.completedWithFailures(phaseName, format("%s out of %s submitted queries failed", statusCount.get(FAILED), queriesSubmitted))); } return postEvent(BenchmarkPhaseEvent.succeeded(phaseName)); }</code><technical_language>== for enum equality, event.getEventStatus() == FAILED</technical_language>

Target:
private BenchmarkPhaseEvent reportProgressUntilFinished(int queriesSubmitted, boolean continueOnFailure) { int completed = 0; double lastProgress = 0; Map<Status, Integer> statusCount = new EnumMap<>(Status.class); while (completed < queriesSubmitted) { try { BenchmarkQueryEvent event = completionService.take().get(); completed++; statusCount.compute(event.getEventStatus(), (status, count) -> count == null ? 1 : count + 1); if (event.getEventStatus() == FAILED && !continueOnFailure) { executor.shutdownNow(); return postEvent(BenchmarkPhaseEvent.failed(phaseName, event.getErrorMessage())); } double progress = ((double) completed) / queriesSubmitted * 100; if (progress - lastProgress > 0.5 || completed == queriesSubmitted) { log.info("Progress: %s succeeded, %s failed, %s submitted, %.2f%% done", statusCount.getOrDefault(SUCCEEDED, 0), statusCount.getOrDefault(FAILED, 0), queriesSubmitted, progress); lastProgress = progress; } } catch (InterruptedException e) { currentThread().interrupt(); if (!continueOnFailure) { executor.shutdownNow(); return postEvent(BenchmarkPhaseEvent.failed(phaseName, e.toString())); } } catch (ExecutionException e) { executor.shutdownNow(); if (!continueOnFailure) { executor.shutdownNow(); return postEvent(BenchmarkPhaseEvent.failed(phaseName, e.toString())); } } } if (statusCount.getOrDefault(FAILED, 0) > 0) { return postEvent(BenchmarkPhaseEvent.completedWithFailures(phaseName, format("%s out of %s submitted queries failed", statusCount.get(FAILED), queriesSubmitted))); } return postEvent(BenchmarkPhaseEvent.succeeded(phaseName)); }