StepUtils { public static void resetSteps(Set<Step> steps) { for (Step step : steps) { step.reset(); } }  static boolean allStepsSubmitted(Set<Step> steps); static boolean allStepsFinished(Set<Step> steps); static Set<Step> getDependencies(Step step, Set<Step> steps); static boolean hasStreamingStep(Set<Step> steps); static Set<StreamingStep> getStreamingSteps(Set<Step> steps); static Set<Step> getAllDependentSteps(Step rootStep, Set<Step> steps); static Set<Step> getImmediateDependentSteps(Step step, Set<Step> steps); static Set<Step> getIndependentNonStreamingSteps(Set<Step> steps); static String stepNamesAsString(Set<? extends Step> steps); static void resetSteps(Set<Step> steps); static void resetRepeatingSteps(Set<Step> allSteps); static Set<DataStep> getDataSteps(Set<Step> steps); static Optional<Step> getStepForName(String name, Set<Step> steps); static Set<Step> copySteps(Set<Step> steps); static Map<String, Dataset<Row>> getStepDataFrames(Set<Step> steps); static Set<Step> extractSteps(Config config, boolean configure, boolean notify); static Set<Step> mergeLoadedSteps(Set<Step> baseSteps, Step parentStep, Config baseConfig); static Map<String, StepState> getStepStates(Set<Step> steps); static Set<Step> getStepsMatchingState(Set<Step> steps, StepState matching);  }
@Test public void testResetSteps() { DataStep step1 = new BatchStep("step1"); DataStep step2 = new BatchStep("step2"); DataStep step3 = new BatchStep("step3"); step1.configure(ConfigFactory.empty()); step2.configure(ConfigFactory.empty()); step3.configure(ConfigFactory.empty()); step1.setData(Contexts.getSparkSession().emptyDataFrame()); step2.setData(Contexts.getSparkSession().emptyDataFrame()); step3.setData(Contexts.getSparkSession().emptyDataFrame()); step1.setState(StepState.WAITING); step2.setState(StepState.SUBMITTED); step3.setState(StepState.FINISHED); Set<Step> steps = Sets.<Step>newHashSet(step1, step2, step3); StepUtils.resetSteps(steps); assertSame(step1.getState(), StepState.WAITING); assertSame(step2.getState(), StepState.WAITING); assertSame(step3.getState(), StepState.WAITING); }