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

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

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

Stage.getParentStageId介绍

暂无

代码示例

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

private boolean isTopLevelStage(Stage stage) {
 return stage.getParentStageId() == null;
}

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

@Override
public void addStage(@Nonnull Stage stage) {
 if (stage.getSyntheticStageOwner() == null || stage.getParentStageId() == null) {
  throw new IllegalArgumentException("Only synthetic stages can be inserted ad-hoc");
 }
 storeStageInternal(getRedisDelegate(stage), stage, true);
}

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

private String generateRefId() {
 long offset = parent
  .getExecution()
  .getStages()
  .stream()
  .filter(i -> parent.getId().equals(i.getParentStageId()) && type == i.getSyntheticStageOwner())
  .count();
 return format(
  "%s%s%d",
  parent.getRefId(),
  type == STAGE_BEFORE ? "<" : ">",
  offset + graph.nodes().size()
 );
}

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

execution.getStages().addAll(
 stages.stream()
  .filter(s -> s.getParentStageId() == null)
  .sorted(Comparator.comparing(Stage::getRefId))
  .collect(Collectors.toList())
 .filter(s -> s.getParentStageId() != null)
 .sorted(Comparator.comparing(Stage::getRefId))
 .forEach(

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

private void storeStageInternal(RedisClientDelegate delegate, Stage stage, Boolean updateIndex) {
 String key = executionKey(stage);
 String indexKey = format("%s:stageIndex", key);
 Map<String, String> serializedStage = serializeStage(stage);
 List<String> keysToRemove = serializedStage.entrySet().stream()
  .filter(e -> e.getValue() == null)
  .map(Map.Entry::getKey)
  .collect(Collectors.toList());
 serializedStage.values().removeIf(Objects::isNull);
 delegate.withTransaction(tx -> {
  tx.hmset(key, serializedStage);
  if (!keysToRemove.isEmpty()) {
   tx.hdel(key, keysToRemove.toArray(new String[0]));
  }
  if (updateIndex) {
   BinaryClient.LIST_POSITION pos = stage.getSyntheticStageOwner() == STAGE_BEFORE ? BEFORE : AFTER;
   tx.linsert(indexKey, pos, stage.getParentStageId(), stage.getId());
  }
  tx.exec();
 });
}

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

/**
 * A Stage is optional if it has an {@link OptionalStageEvaluator} in its
 * context that evaluates {@code false}.
 */
public static boolean isOptional(Stage stage, ContextParameterProcessor contextParameterProcessor) {
 Map stageEnabled = (Map) stage.getContext().get("stageEnabled");
 String type = stageEnabled == null ? null : (String) stageEnabled.get("type");
 String optionalType = type == null ? null : type.toLowerCase();
 if (!OPTIONAL_STAGE_TYPES.containsKey(optionalType)) {
  if (stage.getSyntheticStageOwner() != null || stage.getParentStageId() != null) {
   Stage parentStage = stage
    .getExecution()
    .getStages()
    .stream()
    .filter(it -> it.getId().equals(stage.getParentStageId()))
    .findFirst()
    .orElseThrow(() -> new IllegalStateException(format("stage %s not found", stage.getParentStageId())));
   return isOptional(parentStage, contextParameterProcessor);
  }
  return false;
 }
 try {
  return !stage.mapTo("/stageEnabled", OPTIONAL_STAGE_TYPES.get(optionalType)).evaluate(stage, contextParameterProcessor);
 } catch (InvalidExpression e) {
  log.warn("Unable to determine stage optionality, reason: {} (executionId: {}, stageId: {})", e.getMessage(), stage.getExecution().getId(), stage.getId());
  return false;
 }
}

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

r -> r.getStageBuilder() instanceof AcquireLockStage)
.filter(r ->
 stage.getParentStageId() == null ? r.getStage().getParentStageId() == null :
  stage.getParentStageId().equals(r.getStage().getParentStageId()))
.findFirst();

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

map.put(prefix + "status", stage.getStatus().name());
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()

相关文章