本文整理了Java中com.netflix.spinnaker.orca.pipeline.model.Stage.getName()
方法的一些代码示例,展示了Stage.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Stage.getName()
方法的具体详情如下:
包路径:com.netflix.spinnaker.orca.pipeline.model.Stage
类名称:Stage
方法名:getName
暂无
代码示例来源: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
.stream()
.collect(
Collectors.toMap(s -> s.getName(), s -> s.getContext().get("exception"))
));
代码示例来源:origin: spinnaker/kayenta
.stageStatus(pipeline.getStages()
.stream()
.map(stage -> new StageMetadata(stage.getType(), stage.getName(), stage.getStatus()))
.collect(Collectors.toList()))
.complete(isComplete)
代码示例来源: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
/**
* Checks existence of a Stage by id
* @param obj #root.execution
* @param id the name or id of the stage to check existence
* @return W
*/
static boolean stageExists(Object obj, String id) {
if (obj instanceof Execution) {
Execution execution = (Execution) obj;
return execution.getStages()
.stream()
.anyMatch(i -> id != null && (id.equals(i.getName()) || id.equals(i.getId())));
}
throw new SpelHelperFunctionException(String.format("Invalid first param to #stage(%s). must be an execution", id));
}
代码示例来源: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
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
/**
* Finds a Stage by id
* @param obj #root.execution
* @param id the name or id of the stage to find
* @return a stage specified by id
*/
static Object stage(Object obj, String id) {
if (obj instanceof Execution) {
Execution execution = (Execution) obj;
return execution.getStages()
.stream()
.filter(i -> id != null && (id.equals(i.getName()) || id.equals(i.getId())))
.findFirst()
.orElseThrow(
() -> new SpelHelperFunctionException(
String.format("Unable to locate [%s] using #stage(%s) in execution %s", id, id, execution.getId())
)
);
}
throw new SpelHelperFunctionException(String.format("Invalid first param to #stage(%s). must be an execution", id));
}
代码示例来源:origin: com.netflix.kayenta/kayenta-core
.stream()
.collect(
Collectors.toMap(s -> s.getName(), s -> s.getContext().get("exception"))
));
代码示例来源: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-clouddriver
private TaskResult handleRetrofitError(Stage stage, RetrofitError e) {
if (e.getResponse() == null) {
throw e;
}
switch (e.getResponse().getStatus()) {
case 404:
return new TaskResult(ExecutionStatus.SUCCEEDED);
case 500:
Map<String, Object> error = new HashMap<>();
error.put("lastRetrofitException", new RetrofitExceptionHandler().handle(stage.getName(), e));
LOGGER.error("Unexpected retrofit error {}", error.get("lastRetrofitException"), e);
return new TaskResult(ExecutionStatus.RUNNING, error);
default:
throw e;
}
}
代码示例来源: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.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);
map.put(prefix + "endTime", stage.getEndTime() != null ? stage.getEndTime().toString() : null);
代码示例来源:origin: com.netflix.spinnaker.orca/orca-clouddriver
deleteResult.add(imageId);
} else {
outputs.put("lastRetrofitException", new RetrofitExceptionHandler().handle(stage.getName(), e));
log.error("Unexpected retrofit error {}", outputs.get("lastRetrofitException"), e);
代码示例来源: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
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)
内容来源于网络,如有侵权,请联系作者删除!