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

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

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

Stage.getRequisiteStageRefIds介绍

暂无

代码示例

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

@JsonIgnore public boolean isJoin() {
 return getRequisiteStageRefIds().size() > 1;
}

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

@JsonIgnore public List<Stage> downstreamStages() {
 return getExecution()
  .getStages()
  .stream()
  .filter(it -> it.getRequisiteStageRefIds().contains(getRefId()))
  .collect(toList());
}

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

/**
 * Builds and returns the stages represented in the graph. This method is not
 * typically useful to implementors of {@link StageDefinitionBuilder}, it's used
 * internally and by tests.
 */
public @Nonnull Iterable<Stage> build() {
 requiredPrefix.ifPresent(prefix ->
  graph.nodes().forEach(it -> {
   if (it != prefix && it.getRequisiteStageRefIds().isEmpty()) {
    connect(prefix, it);
   }
  }));
 return graph.nodes();
}

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

/**
 * Sorts stages into order according to their refIds / requisiteStageRefIds.
 */
public static Stream<Stage> topologicalSort(Collection<Stage> stages) {
 List<Stage> unsorted = stages.stream().filter(it -> it.parentStageId == null).collect(toList());
 ImmutableList.Builder<Stage> sorted = ImmutableList.builder();
 Set<String> refIds = new HashSet<>();
 while (!unsorted.isEmpty()) {
  List<Stage> sortable = unsorted.stream()
   .filter(it -> refIds.containsAll(it.getRequisiteStageRefIds()))
   .collect(toList());
  if (sortable.isEmpty()) {
   throw new IllegalStateException(
    format(
     "Invalid stage relationships found %s",
     join(", ", stages.stream().map(it -> format("%s->%s", it.requisiteStageRefIds, it.refId)).collect(toList()))
    )
   );
  }
  sortable
   .forEach(it -> {
    unsorted.remove(it);
    refIds.add(it.refId);
    sorted.add(it);
   });
 }
 return sorted.build().stream();
}

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

/**
 * Makes {@code next} depend on {@code previous} via its
 * {@link Stage#requisiteStageRefIds}. If either {@code next} or
 * {@code previous} are not yet present in the graph this method will add them.
 */
public void connect(@Nonnull Stage previous, @Nonnull Stage next) {
 add(previous);
 add(next);
 Set<String> requisiteStageRefIds = new HashSet<>(next.getRequisiteStageRefIds());
 requisiteStageRefIds.add(previous.getRefId());
 next.setRequisiteStageRefIds(requisiteStageRefIds);
 graph.putEdge(previous, next);
}

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

map.put(prefix + "syntheticStageOwner", stage.getSyntheticStageOwner() != null ? stage.getSyntheticStageOwner().name() : null);
map.put(prefix + "parentStageId", stage.getParentStageId());
if (!stage.getRequisiteStageRefIds().isEmpty()) {
 map.put(prefix + "requisiteStageRefIds", stage.getRequisiteStageRefIds().stream()
  .collect(Collectors.joining(","))
 );

相关文章