本文整理了Java中com.netflix.spinnaker.orca.pipeline.model.Stage.setContext()
方法的一些代码示例,展示了Stage.setContext()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Stage.setContext()
方法的具体详情如下:
包路径:com.netflix.spinnaker.orca.pipeline.model.Stage
类名称:Stage
方法名:setContext
暂无
代码示例来源:origin: spinnaker/kayenta
/**
* 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());
});
}
代码示例来源:origin: com.netflix.kayenta/kayenta-standalone-canary-analysis
/**
* 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());
});
}
代码示例来源:origin: com.netflix.spinnaker.orca/orca-clouddriver
@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);
});
}
}
}
代码示例来源:origin: com.netflix.spinnaker.orca/orca-core
@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
}
}
代码示例来源:origin: com.netflix.spinnaker.orca/orca-clouddriver
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));
});
代码示例来源:origin: com.netflix.spinnaker.orca/orca-redis
stage.setContext(mapper.readValue(map.get(prefix + "context"), MAP_STRING_TO_OBJECT));
} else {
stage.setContext(emptyMap());
内容来源于网络,如有侵权,请联系作者删除!