com.netflix.spinnaker.orca.pipeline.model.Stage.getOutputs()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(7.7k)|赞(0)|评价(0)|浏览(140)

本文整理了Java中com.netflix.spinnaker.orca.pipeline.model.Stage.getOutputs()方法的一些代码示例,展示了Stage.getOutputs()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Stage.getOutputs()方法的具体详情如下:
包路径:com.netflix.spinnaker.orca.pipeline.model.Stage
类名称:Stage
方法名:getOutputs

Stage.getOutputs介绍

暂无

代码示例

代码示例来源:origin: spinnaker/kayenta

private static String resolveMetricSetListId(Stage stage) {
  Map<String, Object> outputs = stage.getOutputs();
  String metricSetListId = (String)outputs.get("metricSetListId");

  // TODO(duftler): Remove this once the risk of operating on out-of-date pipelines is low.
  if (StringUtils.isEmpty(metricSetListId)) {
   // Fallback to the older key name.
   metricSetListId = (String)outputs.get("metricSetId");
  }

  return metricSetListId;
 }
}

代码示例来源:origin: spinnaker/kayenta

.findFirst()
 .orElseThrow(() -> new IllegalArgumentException("Unable to find stage 'compareJudgeResults' in pipeline ID '" + canaryExecutionId + "'"));
Map<String, Object> compareJudgeResultsOutputs = compareJudgeResultsStage.getOutputs();
Boolean isComplete = pipeline.getStatus().isComplete();
String pipelineStatus = pipeline.getStatus().toString().toLowerCase();

代码示例来源:origin: spinnaker/kayenta

.findFirst()
 .orElseThrow(() -> new IllegalArgumentException("Unable to find stage '" + CanaryStageNames.REFID_JUDGE + "' in pipeline ID '" + canaryExecutionId + "'"));
Map<String, Object> judgeOutputs = judgeStage.getOutputs();
 .orElseThrow(() -> new IllegalArgumentException("Unable to find stage '" + CanaryStageNames.REFID_MIX_METRICS + "' in pipeline ID '" + canaryExecutionId + "'"));
Map<String, Object> mixerContext = mixerStage.getContext();
Map<String, Object> mixerOutputs = mixerStage.getOutputs();

代码示例来源:origin: spinnaker/kayenta

.findFirst()
.ifPresent(generateCanaryAnalysisResultStage -> Optional
  .ofNullable(generateCanaryAnalysisResultStage.getOutputs()
    .getOrDefault(CANARY_ANALYSIS_EXECUTION_RESULT, null))
.ifPresent(data -> responseBuilder.canaryAnalysisExecutionResult(kayentaObjectMapper.convertValue(data,

代码示例来源:origin: com.netflix.kayenta/kayenta-core

private static String resolveMetricSetListId(Stage stage) {
  Map<String, Object> outputs = stage.getOutputs();
  String metricSetListId = (String)outputs.get("metricSetListId");

  // TODO(duftler): Remove this once the risk of operating on out-of-date pipelines is low.
  if (StringUtils.isEmpty(metricSetListId)) {
   // Fallback to the older key name.
   metricSetListId = (String)outputs.get("metricSetId");
  }

  return metricSetListId;
 }
}

代码示例来源:origin: com.netflix.spinnaker.orca/orca-core

private static Map<String, Object> findBuildInfoInUpstreamStage(Stage currentStage,
                                List<Pattern> packageFilePatterns) {
 Stage upstreamStage = currentStage
  .ancestors()
  .stream()
  .filter(it -> {
   Map<String, Object> buildInfo = (Map<String, Object>) it.getOutputs().get("buildInfo");
   return buildInfo != null &&
    artifactMatch((List<Map<String, String>>) buildInfo.get("artifacts"), packageFilePatterns);
  })
  .findFirst()
  .orElse(null);
 return upstreamStage != null ? (Map<String, Object>) upstreamStage.getOutputs().get("buildInfo") : emptyMap();
}

代码示例来源:origin: com.netflix.spinnaker.orca/orca-core

@Override public Object get(@Nullable Object key) {
 if (delegate().containsKey(key)) {
  return super.get(key);
 } else {
  return stage
   .ancestors()
   .stream()
   .filter(it -> it.getOutputs().containsKey(key))
   .findFirst()
   .map(it -> it.getOutputs().get(key))
   .orElse(null);
 }
}

代码示例来源:origin: com.netflix.spinnaker.orca/orca-core

public @Nonnull
List<Artifact> getAllArtifacts(@Nonnull Execution execution) {
 // Get all artifacts emitted by the execution's stages; we'll sort the stages topologically,
 // then reverse the result so that artifacts from later stages will appear
 // earlier in the results.
 List<Artifact> emittedArtifacts = Stage.topologicalSort(execution.getStages())
  .filter(s -> s.getOutputs().containsKey("artifacts"))
  .flatMap(
   s -> (Stream<Artifact>) ((List) s.getOutputs().get("artifacts"))
     .stream()
     .map(a -> a instanceof Map ? objectMapper.convertValue(a, Artifact.class) : a)
  ).collect(Collectors.toList());
 Collections.reverse(emittedArtifacts);
 // Get all artifacts in the parent pipeline's trigger; these artifacts go at the end of the list,
 // after any that were emitted by the pipeline
 List<Artifact> triggerArtifacts = objectMapper.convertValue(execution.getTrigger().getArtifacts(), new TypeReference<List<Artifact>>() {});
 emittedArtifacts.addAll(triggerArtifacts);
 return emittedArtifacts;
}

代码示例来源:origin: com.netflix.spinnaker.orca/orca-core

@SuppressWarnings("unchecked")
 public <E> List<E> getAll(Object key) {
  List<E> result = (List<E>) stage
   .ancestors()
   .stream()
   .filter(it -> it.getOutputs().containsKey(key))
   .map(it -> it.getOutputs().get(key))
   .collect(toList());

  if (delegate.containsKey(key)) {
   result.add(0, (E) delegate.get(key));
  }

  if (key.equals("artifacts")) {
   result.add((E) getTrigger().getArtifacts());
  } else if (key.equals("resolvedExpectedArtifacts")) {
   result.add((E) getTrigger().getResolvedExpectedArtifacts());
  }

  return result;
 }
}

代码示例来源:origin: com.netflix.kayenta/kayenta-core

.findFirst()
 .orElseThrow(() -> new IllegalArgumentException("Unable to find stage 'compareJudgeResults' in pipeline ID '" + canaryExecutionId + "'"));
Map<String, Object> compareJudgeResultsOutputs = compareJudgeResultsStage.getOutputs();
Boolean isComplete = pipeline.getStatus().isComplete();
String pipelineStatus = pipeline.getStatus().toString().toLowerCase();

代码示例来源:origin: com.netflix.spinnaker.orca/orca-redis

try {
 map.put(prefix + "context", mapper.writeValueAsString(stage.getContext()));
 map.put(prefix + "outputs", mapper.writeValueAsString(stage.getOutputs()));
 map.put(prefix + "tasks", mapper.writeValueAsString(stage.getTasks()));
 map.put(prefix + "lastModified", (stage.getLastModified() != null ? mapper.writeValueAsString(stage.getLastModified()) : null));

代码示例来源:origin: com.netflix.spinnaker.orca/orca-clouddriver

@Override
public TaskResult execute(@Nonnull Stage stage) {
 DeleteImageStage.DeleteImageRequest deleteImageRequest = stage.mapTo(DeleteImageStage.DeleteImageRequest.class);
 List<String> deleteResult = (List<String>) Optional.ofNullable(stage.getOutputs().get("delete.image.ids"))
  .orElse(new ArrayList<>());

代码示例来源:origin: com.netflix.spinnaker.orca/orca-clouddriver

StageData stageData = parent.mapTo(StageData.class);
Map<String, Object> parentOutputs = parent.getOutputs();
Map<String, String> rollbackTypes = (Map<String, String>) parentOutputs.get("rollbackTypes");
Map<String, Map<String, Object>> rollbackContexts = (Map<String, Map<String, Object>>) parentOutputs.get("rollbackContexts");
 context.put(
  "rollbackType",
  ((Map) parent.getOutputs().get("rollbackTypes")).get(region)
 );

代码示例来源:origin: com.netflix.kayenta/kayenta-core

.findFirst()
 .orElseThrow(() -> new IllegalArgumentException("Unable to find stage '" + CanaryStageNames.REFID_JUDGE + "' in pipeline ID '" + canaryExecutionId + "'"));
Map<String, Object> judgeOutputs = judgeStage.getOutputs();
 .orElseThrow(() -> new IllegalArgumentException("Unable to find stage '" + CanaryStageNames.REFID_MIX_METRICS + "' in pipeline ID '" + canaryExecutionId + "'"));
Map<String, Object> mixerContext = mixerStage.getContext();
Map<String, Object> mixerOutputs = mixerStage.getOutputs();

代码示例来源:origin: com.netflix.kayenta/kayenta-standalone-canary-analysis

.findFirst()
.ifPresent(generateCanaryAnalysisResultStage -> Optional
  .ofNullable(generateCanaryAnalysisResultStage.getOutputs()
    .getOrDefault(CANARY_ANALYSIS_EXECUTION_RESULT, null))
.ifPresent(data -> responseBuilder.canaryAnalysisExecutionResult(kayentaObjectMapper.convertValue(data,

相关文章