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

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

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

Stage.getType介绍

暂无

代码示例

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

/**
 * Gets the run canary stages that contain the results
 */
@NotNull
protected List<Stage> getRunCanaryStages(@Nonnull Stage stage) {
 // Collect the Run Canary Stages where the parent id is itself
 // Sorting by number after the # in the name
 return stage.getExecution().getStages().stream()
   .filter(s -> s.getType().equals(RunCanaryStage.STAGE_TYPE))
   .sorted(Comparator.comparing(s -> Integer.valueOf(StringUtils.substringAfterLast(s.getName(), "#"))))
   .collect(Collectors.toList());
}

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

.stageStatus(pipeline.getStages()
  .stream()
  .map(stage -> new StageMetadata(stage.getType(), stage.getName(), stage.getStatus()))
  .collect(Collectors.toList()))
.complete(isComplete)
.filter(stage -> stage.getType().equals(SetupAndExecuteCanariesStage.STAGE_TYPE))
.findFirst()
.ifPresent(stage -> Optional
.filter(stage -> stage.getType().equals(GenerateCanaryAnalysisResultStage.STAGE_TYPE))
.findFirst()
.ifPresent(generateCanaryAnalysisResultStage -> Optional

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

@Override
public boolean supports(String cloudProvider, Stage stage) {
 if (!cloudProvider.equals(TITUS)) {
  return false;
 }
 return SUPPORTED_STAGES.contains(stage.getType().toLowerCase());
}

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

public boolean supports(String cloudProvider, Stage stage) {
 if (!cloudProvider.equals(KUBERNETES)) {
  return false;
 }
 return SUPPORTED_STAGES.contains(stage.getType().toLowerCase());
}

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

@Nullable
public Stage namedStage(String type) {
 return stages
  .stream()
  .filter(it -> it.getType().equals(type))
  .findFirst()
  .orElse(null);
}

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

/**
 * Gets the run canary stages that contain the results
 */
@NotNull
protected List<Stage> getRunCanaryStages(@Nonnull Stage stage) {
 // Collect the Run Canary Stages where the parent id is itself
 // Sorting by number after the # in the name
 return stage.getExecution().getStages().stream()
   .filter(s -> s.getType().equals(RunCanaryStage.STAGE_TYPE))
   .sorted(Comparator.comparing(s -> Integer.valueOf(StringUtils.substringAfterLast(s.getName(), "#"))))
   .collect(Collectors.toList());
}

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

/**
 * As per `Stage.ancestors` except this method returns tuples of the stages
 * and their `StageDefinitionBuilder`.
 */
public List<Result> ancestors(Stage startingStage) {
 return startingStage
  .ancestors()
  .stream()
  .map(it ->
   new Result(it, stageDefinitionBuilders.get(it.getType()))
  )
  .collect(toList());
}

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

@Override
 public @Nonnull StageDefinitionBuilder builderFor(
  @Nonnull Stage stage) throws NoSuchStageDefinitionBuilder {
  return stageDefinitionBuilders
   .stream()
   .filter((it) -> it.getType().equals(stage.getType()) || it.getType().equals(stage.getContext().get("alias")))
   .findFirst()
   .orElseThrow(() -> {
    List<String> knownTypes = stageDefinitionBuilders.stream().map(it -> it.getType()).sorted().collect(toList());
    return new NoSuchStageDefinitionBuilder(stage.getType(), knownTypes);
   });
 }
}

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

private static Predicate<Stage> matchesDeployedStage(String ...id) {
  List<String> idsOrNames = Arrays.asList(id);
  if (!idsOrNames.isEmpty()){
   return stage -> DEPLOY_STAGE_NAMES.contains(stage.getType()) &&
    stage.getContext().containsKey("deploy.server.groups") &&
    stage.getStatus() == ExecutionStatus.SUCCEEDED &&
    (idsOrNames.contains(stage.getName()) || idsOrNames.contains(stage.getId()));
  } else {
   return stage -> DEPLOY_STAGE_NAMES.contains(stage.getType()) &&
    stage.getContext().containsKey("deploy.server.groups") && stage.getStatus() == ExecutionStatus.SUCCEEDED;
  }
 }
}

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

private static Predicate<Stage> isManualStageWithManualInput(String id) {
 return i -> (id != null && id.equals(i.getName())) && (i.getContext() != null && i.getType().equals("manualJudgment") && i.getContext().get("judgmentInput") != null);
}

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

.filter(it -> "deploy".equals(it.getType()))
.forEach(deployStage -> {
 List<Map> clusters = (List<Map>) deployStage.getContext().getOrDefault("clusters", new ArrayList<>());
.filter(it -> "canary".equals(it.getType()))
.forEach(canaryStage -> {
 List<Map> clusterPairs = (List<Map>)canaryStage.getContext().getOrDefault("clusterPairs", new ArrayList<>());

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

stage.getExecution().getStages()
 .stream()
 .filter(s -> lockTypes.contains(s.getType()) && s.getStatus() == ExecutionStatus.SUCCEEDED)
 .forEach(s -> {
 LockContext lc = s.mapTo("/lock", LockContext.LockContextBuilder.class).withStage(s).build();
  new HeldLock(lc.getLockName(), lc.getLockValue()),
  hl -> new AtomicInteger(0));
 if (AcquireLockStage.PIPELINE_TYPE.equals(s.getType())) {
  count.incrementAndGet();
 } else {

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

public StageStarted(
 @Nonnull Object source,
 @Nonnull Stage stage
) {
 this(source, stage.getExecution().getType(), stage.getExecution().getId(), stage.getId(), stage.getType(), stage.getName());
}

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

public StageComplete(
 @Nonnull Object source,
 @Nonnull Stage stage
) {
 this(source, stage.getExecution().getType(), stage.getExecution().getId(), stage.getId(), stage.getType(), stage.getName(), stage.getStatus());
}

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

Map<String, String> map = new HashMap<>();
map.put(prefix + "refId", stage.getRefId());
map.put(prefix + "type", stage.getType());
map.put(prefix + "name", stage.getName());
map.put(prefix + "startTime", stage.getStartTime() != null ? stage.getStartTime().toString() : null);

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

public TaskStarted(
 @Nonnull Object source,
 @Nonnull Stage stage,
 @Nonnull Task task
) {
 this(
  source,
  stage.getExecution().getType(),
  stage.getExecution().getId(),
  stage.getId(),
  stage.getType(),
  stage.getName(),
  task.getId(),
  task.getImplementingClass(),
  task.getName()
 );
}

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

@Override
 public void onApplicationEvent(ExecutionComplete event) {
  if (!lockingConfigurationProperties.isEnabled()) {
   return;
  }
  if (event.getStatus().isHalt()) {
   try {
    MDC.put(AGENT_MDC_KEY, this.getClass().getSimpleName());

    Execution execution = executionRepository.retrieve(event.getExecutionType(), event.getExecutionId());
    execution.getStages().forEach(s -> {
     if (AcquireLockStage.PIPELINE_TYPE.equals(s.getType())) {
      try {
       LockContext lc = s.mapTo("/lock", LockContext.LockContextBuilder.class).withStage(s).build();
       lockManager.releaseLock(lc.getLockName(), lc.getLockValue(), lc.getLockHolder());
      } catch (LockFailureException lfe) {
       logger.info("Failure releasing lock in ExecutionCompleteLockReleasingListener - ignoring", lfe);
      }
     }
    });
   } finally {
    MDC.remove(AGENT_MDC_KEY);
   }
  }
 }
}

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

public TaskComplete(
 @Nonnull Object source,
 @Nonnull Stage stage,
 @Nonnull Task task
) {
 this(
  source,
  stage.getExecution().getType(),
  stage.getExecution().getId(),
  stage.getId(),
  stage.getType(),
  stage.getName(),
  task.getId(),
  task.getImplementingClass(),
  task.getName(),
  task.getStatus()
 );
}

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

.stageStatus(pipeline.getStages()
  .stream()
  .map(stage -> new StageMetadata(stage.getType(), stage.getName(), stage.getStatus()))
  .collect(Collectors.toList()))
.complete(isComplete)
.filter(stage -> stage.getType().equals(SetupAndExecuteCanariesStage.STAGE_TYPE))
.findFirst()
.ifPresent(stage -> Optional
.filter(stage -> stage.getType().equals(GenerateCanaryAnalysisResultStage.STAGE_TYPE))
.findFirst()
.ifPresent(generateCanaryAnalysisResultStage -> Optional

相关文章