本文整理了Java中com.netflix.spinnaker.orca.pipeline.model.Execution.getStatus()
方法的一些代码示例,展示了Execution.getStatus()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Execution.getStatus()
方法的具体详情如下:
包路径:com.netflix.spinnaker.orca.pipeline.model.Execution
类名称:Execution
方法名:getStatus
暂无
代码示例来源:origin: spinnaker/kayenta
@ApiOperation(value = "Cancel a pipeline execution")
@RequestMapping(value = "/{executionId}/cancel", method = RequestMethod.PUT)
@ResponseStatus(HttpStatus.ACCEPTED)
void cancel(@PathVariable String executionId) {
log.info("Cancelling pipeline execution {}...", executionId);
Execution pipeline = executionRepository.retrieve(Execution.ExecutionType.PIPELINE, executionId);
if (pipeline.getStatus().isComplete()) {
log.debug("Not changing status of pipeline execution {} to CANCELED since execution is already completed: {}", executionId, pipeline.getStatus());
return;
}
executionRepository.cancel(Execution.ExecutionType.PIPELINE, executionId);
executionRepository.updateStatus(Execution.ExecutionType.PIPELINE, executionId, ExecutionStatus.CANCELED);
}
代码示例来源:origin: spinnaker/kayenta
.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();
ImmutableMap.Builder<String, Object> comparisonResult = ImmutableMap.builder();
代码示例来源:origin: spinnaker/kayenta
if (pipeline.getStatus().isComplete()) {
log.debug("Not changing status of pipeline execution {} to CANCELED since execution is already completed: {}", canaryPipelineExecutionId, pipeline.getStatus());
return new CancellableStage.Result(stage, new HashMap<>());
代码示例来源:origin: spinnaker/kayenta
.collect(Collectors.toMap(Stage::getRefId, s -> s.getStatus().toString().toLowerCase()));
Boolean isComplete = pipeline.getStatus().isComplete();
String pipelineStatus = pipeline.getStatus().toString().toLowerCase();
代码示例来源:origin: spinnaker/kayenta
boolean isComplete = pipeline.getStatus().isComplete();
ExecutionStatus pipelineStatus = pipeline.getStatus();
CanaryAnalysisExecutionStatusResponse.CanaryAnalysisExecutionStatusResponseBuilder responseBuilder =
CanaryAnalysisExecutionStatusResponse.builder()
代码示例来源:origin: com.netflix.kayenta/kayenta-orca
@ApiOperation(value = "Cancel a pipeline execution")
@RequestMapping(value = "/{executionId}/cancel", method = RequestMethod.PUT)
@ResponseStatus(HttpStatus.ACCEPTED)
void cancel(@PathVariable String executionId) {
log.info("Cancelling pipeline execution {}...", executionId);
Execution pipeline = executionRepository.retrieve(Execution.ExecutionType.PIPELINE, executionId);
if (pipeline.getStatus().isComplete()) {
log.debug("Not changing status of pipeline execution {} to CANCELED since execution is already completed: {}", executionId, pipeline.getStatus());
return;
}
executionRepository.cancel(Execution.ExecutionType.PIPELINE, executionId);
executionRepository.updateStatus(Execution.ExecutionType.PIPELINE, executionId, ExecutionStatus.CANCELED);
}
代码示例来源:origin: com.netflix.spinnaker.orca/orca-redis
@Override
public @Nonnull List<Execution> retrieveBufferedExecutions() {
List<Observable<Execution>> observables = allRedisDelegates().stream()
.map(d -> Arrays.asList(
retrieveObservable(PIPELINE, allBufferedExecutionsKey(PIPELINE), queryAllScheduler, d),
retrieveObservable(ORCHESTRATION, allBufferedExecutionsKey(ORCHESTRATION), queryAllScheduler, d)
))
.flatMap(List::stream)
.collect(Collectors.toList());
return Observable.merge(observables)
.filter(e -> e.getStatus() == BUFFERED)
.toList()
.toBlocking().single();
}
代码示例来源:origin: com.netflix.spinnaker.orca/orca-clouddriver
boolean hasCompletedExecution(PinnedServerGroupTag pinnedServerGroupTag) {
try {
Execution execution = executionRepository.retrieve(
pinnedServerGroupTag.executionType, pinnedServerGroupTag.executionId
);
return execution.getStatus().isComplete();
} catch (ExecutionNotFoundException e) {
return true;
} catch (Exception e) {
log.warn("Unable to determine status of execution (executionId: {})", pinnedServerGroupTag.executionId, e);
errorsCounter.increment();
return false;
}
}
代码示例来源:origin: com.netflix.spinnaker.orca/orca-redis
@Override
public @Nonnull
List<Execution> retrievePipelinesForPipelineConfigIdsBetweenBuildTimeBoundary(
@Nonnull List<String> pipelineConfigIds,
long buildTimeStartBoundary,
long buildTimeEndBoundary,
ExecutionCriteria executionCriteria
) {
List<Execution> executions = new ArrayList<>();
allRedisDelegates()
.forEach(d -> {
List<Execution> pipelines = getPipelinesForPipelineConfigIdsBetweenBuildTimeBoundaryFromRedis(
d,
pipelineConfigIds,
buildTimeStartBoundary,
buildTimeEndBoundary
);
executions.addAll(pipelines);
});
return executions.stream()
.filter( it -> {
if (executionCriteria.getStatuses().isEmpty()) {
return true;
} else {
return executionCriteria.getStatuses().contains(it.getStatus());
}
})
.collect(Collectors.toList());
}
代码示例来源:origin: com.netflix.spinnaker.orca/orca-core
@Override
public Boolean call(Execution execution) {
if (!COMPLETED_STATUSES.contains(execution.getStatus().toString())) {
return false;
}
long startTime = execution.getStartTime() == null ? execution.getBuildTime() : execution.getStartTime();
return startTime <= (Instant.ofEpochMilli(clock.millis()).minus(thresholdDays, ChronoUnit.DAYS).toEpochMilli());
}
};
代码示例来源:origin: com.netflix.kayenta/kayenta-core
.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();
ImmutableMap.Builder<String, Object> comparisonResult = ImmutableMap.builder();
代码示例来源:origin: com.netflix.spinnaker.orca/orca-redis
@Override
public
@Nonnull Observable<Execution> retrieve(
@Nonnull ExecutionType type,
@Nonnull ExecutionCriteria criteria
) {
List<Observable<Execution>> observables = allRedisDelegates()
.stream()
.map(d -> {
Observable<Execution> observable = all(type, d);
if (!criteria.getStatuses().isEmpty()) {
observable = observable.filter(execution -> criteria.getStatuses().contains(execution.getStatus()));
}
if (criteria.getPageSize() > 0) {
observable = observable.limit(criteria.getPageSize());
}
return observable;
}
)
.collect(Collectors.toList());
return Observable.merge(observables);
}
代码示例来源:origin: com.netflix.spinnaker.orca/orca-core
@Override
public void afterExecution(Persister persister,
Execution execution,
ExecutionStatus executionStatus,
boolean wasSuccessful) {
if (!execution.getStatus().isSuccessful()) {
// only want to cleanup executions that successfully completed
return;
}
List<Stage> stages = execution.getStages();
stages.forEach(it -> {
if (it.getContext().containsKey("targetReferences")) {
// remove `targetReferences` as it's large and unnecessary after a pipeline has completed
it.getContext().remove("targetReferences");
persister.save(it);
}
});
}
代码示例来源:origin: com.netflix.spinnaker.orca/orca-redis
map.put("endTime", execution.getEndTime() != null ? execution.getEndTime().toString() : null);
map.put("startTimeExpiry", execution.getStartTimeExpiry() != null ? String.valueOf(execution.getStartTimeExpiry()) : null);
map.put("status", execution.getStatus().name());
map.put("authentication", mapper.writeValueAsString(execution.getAuthentication()));
map.put("paused", mapper.writeValueAsString(execution.getPaused()));
代码示例来源:origin: com.netflix.kayenta/kayenta-standalone-canary-analysis
if (pipeline.getStatus().isComplete()) {
log.debug("Not changing status of pipeline execution {} to CANCELED since execution is already completed: {}", canaryPipelineExecutionId, pipeline.getStatus());
return new CancellableStage.Result(stage, new HashMap<>());
代码示例来源:origin: com.netflix.spinnaker.orca/orca-redis
@Override
public @Nonnull
Execution retrieveOrchestrationForCorrelationId(
@Nonnull String correlationId) throws ExecutionNotFoundException {
String key = format("correlation:%s", correlationId);
return getRedisDelegate(key).withCommandsClient(correlationRedis -> {
String orchestrationId = correlationRedis.get(key);
if (orchestrationId != null) {
Execution orchestration = retrieveInternal(
getRedisDelegate(orchestrationKey(orchestrationId)),
ORCHESTRATION,
orchestrationId);
if (!orchestration.getStatus().isComplete()) {
return orchestration;
}
correlationRedis.del(key);
}
throw new ExecutionNotFoundException(
format("No Orchestration found for correlation ID %s", correlationId)
);
});
}
代码示例来源:origin: com.netflix.spinnaker.orca/orca-redis
@Nonnull
@Override
public Execution retrievePipelineForCorrelationId(@Nonnull String correlationId) throws ExecutionNotFoundException {
String key = format("pipelineCorrelation:%s", correlationId);
return getRedisDelegate(key).withCommandsClient(correlationRedis -> {
String pipelineId = correlationRedis.get(key);
if (pipelineId != null) {
Execution pipeline = retrieveInternal(
getRedisDelegate(pipelineKey(pipelineId)),
PIPELINE,
pipelineId
);
if (!pipeline.getStatus().isComplete()) {
return pipeline;
}
correlationRedis.del(key);
}
throw new ExecutionNotFoundException(
format("No Pipeline found for correlation ID %s", correlationId)
);
});
}
代码示例来源:origin: com.netflix.kayenta/kayenta-core
.collect(Collectors.toMap(Stage::getRefId, s -> s.getStatus().toString().toLowerCase()));
Boolean isComplete = pipeline.getStatus().isComplete();
String pipelineStatus = pipeline.getStatus().toString().toLowerCase();
代码示例来源:origin: com.netflix.kayenta/kayenta-standalone-canary-analysis
boolean isComplete = pipeline.getStatus().isComplete();
ExecutionStatus pipelineStatus = pipeline.getStatus();
CanaryAnalysisExecutionStatusResponse.CanaryAnalysisExecutionStatusResponseBuilder responseBuilder =
CanaryAnalysisExecutionStatusResponse.builder()
代码示例来源:origin: com.netflix.spinnaker.orca/orca-redis
c.sadd(appKey(execution.getType(), execution.getApplication()), execution.getId());
if (execution.getStatus() == BUFFERED) {
c.sadd(allBufferedExecutionsKey(execution.getType()), execution.getId());
} else {
内容来源于网络,如有侵权,请联系作者删除!