/** * Always run the GenerateCanaryAnalysisResultStage. */ private void addAlwaysRunResultStage(@Nonnull Stage parent, @Nonnull StageGraphBuilder graph) { graph.append(stage -> { stage.setType(GenerateCanaryAnalysisResultStage.STAGE_TYPE); stage.setName(GenerateCanaryAnalysisResultStage.STAGE_DESCRIPTION); stage.setContext(parent.getContext()); }); }
/** * Always run the GenerateCanaryAnalysisResultStage. */ private void addAlwaysRunResultStage(@Nonnull Stage parent, @Nonnull StageGraphBuilder graph) { graph.append(stage -> { stage.setType(GenerateCanaryAnalysisResultStage.STAGE_TYPE); stage.setName(GenerateCanaryAnalysisResultStage.STAGE_DESCRIPTION); stage.setContext(parent.getContext()); }); }
@Override public void addAdditionalBeforeStages( @Nonnull Stage parent, @Nonnull StageGraphBuilder graph ) { if (Objects.equals(parent.getContext().get("allowDeleteActive"), true)) { Map<String, Object> context = new HashMap<>(parent.getContext()); context.put("remainingEnabledServerGroups", parent.getContext().get("shrinkToSize")); context.put("preferLargerOverNewer", parent.getContext().get("retainLargerOverNewer")); context.put("continueIfClusterNotFound", Objects.equals(parent.getContext().get("shrinkToSize"), 0)); // We don't want the key propagated if interestingHealthProviderNames isn't defined, since this prevents // health providers from the stage's 'determineHealthProviders' task to be added to the context. if (parent.getContext().get("interestingHealthProviderNames") != null) { context.put("interestingHealthProviderNames", parent.getContext().get("interestingHealthProviderNames")); } graph.add((it) -> { it.setType(disableClusterStage.getType()); it.setName("disableCluster"); it.setContext(context); }); } } }
@Override public void taskGraph( @Nonnull Stage stage, @Nonnull TaskNode.Builder builder) { builder.withTask("suspendExecutionDuringTimeWindow", SuspendExecutionDuringTimeWindowTask.class); try { JitterConfig jitter = stage.mapTo("/restrictedExecutionWindow/jitter", JitterConfig.class); if (jitter.enabled && jitter.maxDelay > 0) { if (jitter.skipManual && stage.getExecution().getTrigger().getType().equals("manual")) { return; } long waitTime = ThreadLocalRandom.current().nextLong(jitter.minDelay, jitter.maxDelay + 1); stage.setContext(contextWithWait(stage.getContext(), waitTime)); builder.withTask("waitForJitter", WaitTask.class); } } catch (IllegalArgumentException e) { // Do nothing } }
it.setType(RollbackServerGroupStage.PIPELINE_CONFIG_TYPE); it.setName("Rollback " + region); it.setContext(context); }); it.setType(WaitStage.STAGE_TYPE); it.setName("Wait after " + region); it.setContext(Collections.singletonMap("waitTime", stageData.waitTimeBetweenRegions)); });
stage.setContext(mapper.readValue(map.get(prefix + "context"), MAP_STRING_TO_OBJECT)); } else { stage.setContext(emptyMap());