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

x33g5p2x  于2022-01-19 转载在 其他  
字(9.2k)|赞(0)|评价(0)|浏览(115)

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

Execution.getId介绍

暂无

代码示例

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

private String startPipeline(Map config) throws Exception {
  String json = kayentaObjectMapper.writeValueAsString(config);

  log.info("Requested pipeline: {}", json);

  Execution pipeline = executionLauncher.start(Execution.ExecutionType.PIPELINE, json);

  return pipeline.getId();
 }
}

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

public CanaryConfig getCanaryConfig(Execution pipeline) {
 Stage contextStage = pipeline.getStages().stream()
  .filter(stage -> stage.getRefId().equals(CanaryStageNames.REFID_SET_CONTEXT))
  .findFirst()
  .orElseThrow(() -> new IllegalArgumentException("Unable to find stage '" + CanaryStageNames.REFID_SET_CONTEXT + "' in pipeline ID '" + pipeline.getId() + "'"));
 Map<String, Object> context = contextStage.getContext();
 Map<String, Object> canaryConfigMap = (Map<String, Object>)context.get("canaryConfig");
 return objectMapper.convertValue(canaryConfigMap, CanaryConfig.class);
}

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

private void handleStartupFailure(Execution execution, Throwable failure) {
 final String canceledBy = "system";
 final String reason = "Failed on startup: " + failure.getMessage();
 final ExecutionStatus status = ExecutionStatus.TERMINAL;
 log.error("Failed to start {} {}", execution.getType(), execution.getId(), failure);
 executionRepository.updateStatus(execution.getType(), execution.getId(), status);
 executionRepository.cancel(execution.getType(), execution.getId(), canceledBy, reason);
}

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

public String getCanaryExecutionRequestFromJudgeContext(Execution pipeline) {
 Stage contextStage = pipeline.getStages().stream()
  .filter(stage -> stage.getRefId().equals(CanaryStageNames.REFID_JUDGE))
  .findFirst()
  .orElseThrow(() -> new IllegalArgumentException("Unable to find stage '" + CanaryStageNames.REFID_JUDGE + "' in pipeline ID '" + pipeline.getId() + "'"));
 Map<String, Object> context = contextStage.getContext();
 return (String) context.get("canaryExecutionRequest");
}

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

public CanaryExecutionStatusResponse fromExecution(Execution pipeline) {
 String canaryExecutionId = pipeline.getId();
 Stage contextStage = pipeline.getStages().stream()
  .filter(stage -> stage.getRefId().equals(CanaryStageNames.REFID_SET_CONTEXT))
  .findFirst()
  .orElseThrow(() -> new IllegalArgumentException("Unable to find stage '" + CanaryStageNames.REFID_SET_CONTEXT + "' in pipeline ID '" + canaryExecutionId + "'"));
 Map<String, Object> contextContext = contextStage.getContext();
 String storageAccountName = (String)contextContext.get("storageAccountName");
 return fromExecution(storageAccountName, pipeline);
}

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

@Override
 public void processCompletedPipelineExecution(Execution execution) {
  CanaryAnalysisExecutionStatusResponse canaryAnalysisExecution = canaryAnalysisService
    .getCanaryAnalysisExecution(execution.getId());
  applicationEventPublisher.publishEvent(new StandaloneCanaryAnalysisExecutionCompletedEvent(this, canaryAnalysisExecution));
 }
}

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

private void handleStartupFailure(Execution execution, Throwable failure) {
 final String canceledBy = "system";
 final String reason = "Failed on startup: " + failure.getMessage();
 final ExecutionStatus status = ExecutionStatus.TERMINAL;
 log.error("Failed to start {} {}", execution.getType(), execution.getId(), failure);
 executionRepository.updateStatus(execution.getType(), execution.getId(), status);
 executionRepository.cancel(execution.getType(), execution.getId(), canceledBy, reason);
 registry.counter(failureId).increment();
}

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

public CanaryExecutionRequest getCanaryExecutionRequest(Execution pipeline) {
 Stage contextStage = pipeline.getStages().stream()
  .filter(stage -> stage.getRefId().equals(CanaryStageNames.REFID_SET_CONTEXT))
  .findFirst()
  .orElseThrow(() -> new IllegalArgumentException("Unable to find stage '" + CanaryStageNames.REFID_SET_CONTEXT + "' in pipeline ID '" + pipeline.getId() + "'"));
 Map<String, Object> context = contextStage.getContext();
 String canaryExecutionRequestJSON = (String)context.get("canaryExecutionRequest");
 if (canaryExecutionRequestJSON == null) {
  canaryExecutionRequestJSON = getCanaryExecutionRequestFromJudgeContext(pipeline);
 }
 if (canaryExecutionRequestJSON == null) {
  return null;
 }
 CanaryExecutionRequest canaryExecutionRequest = null;
 try {
  canaryExecutionRequest = objectMapper.readValue(canaryExecutionRequestJSON, CanaryExecutionRequest.class);
 } catch (IOException e) {
  log.error("Cannot deserialize canaryExecutionRequest", e);
  throw new IllegalArgumentException("Cannot deserialize canaryExecutionRequest", e);
 }
 return canaryExecutionRequest;
}

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

public Map getJudgeComparisonResults(@PathVariable String executionId) {
 Execution pipeline = executionRepository.retrieve(Execution.ExecutionType.PIPELINE, executionId);
 String canaryExecutionId = pipeline.getId();
 Stage compareJudgeResultsStage = pipeline.getStages().stream()
  .filter(stage -> stage.getRefId().equals("compareJudgeResults"))

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

stage.getId(), stage.getExecution().getId(), canaryPipelineExecutionId, stage.getContext());
} catch (Exception e) {
 log.error("Failed to cancel stage (stageId: {}, executionId: {}), e: {}",
   stage.getId(), stage.getExecution().getId(), e.getMessage(), e);
  stage.getId(), stage.getExecution().getId(), stage.getContext());

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

return CanaryExecutionResponse.builder().canaryExecutionId(pipeline.getId()).build();

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

return CanaryExecutionResponse.builder().canaryExecutionId(pipeline.getId()).build();

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

.orElseThrow(() -> new IllegalArgumentException("No storage service was configured; unable to retrieve results."));
String canaryExecutionId = pipeline.getId();
  .application((String)contextContext.get("application"))
  .parentPipelineExecutionId((String)contextContext.get("parentPipelineExecutionId"))
  .pipelineId(pipeline.getId())
  .storageAccountName(storageAccountName);
if (contextContext.containsKey("canaryConfigId")) {

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

stage.getExecution().getId(),
Optional.ofNullable(context.getCanaryConfigId()).orElse(AD_HOC),
request.getCanaryConfig(),

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

CanaryAnalysisExecutionStatusResponse.builder()
.application(pipeline.getApplication())
.pipelineId(pipeline.getId())
.stageStatus(pipeline.getStages()
  .stream()

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

/**
 * Initiates the canary analysis execution Orca pipeline.
 *
 * @param canaryAnalysisConfig The configuration for the canary analysis execution.
 * @return Wrapper object around the execution id.
 */
public CanaryAnalysisExecutionResponse initiateCanaryAnalysisExecution(CanaryAnalysisConfig canaryAnalysisConfig) {
 String application = canaryAnalysisConfig.getApplication();
 PipelineBuilder pipelineBuilder = new PipelineBuilder(application)
   .withName(CANARY_ANALYSIS_PIPELINE_NAME)
   .withPipelineConfigId(application + "-canary-analysis-referee-pipeline")
   .withStage(
     SetupAndExecuteCanariesStage.STAGE_TYPE,
     SetupAndExecuteCanariesStage.STAGE_DESCRIPTION,
     Maps.newHashMap(ImmutableMap.of(
       CANARY_ANALYSIS_CONFIG_CONTEXT_KEY, canaryAnalysisConfig
     )));
 Execution pipeline = pipelineBuilder.withLimitConcurrent(false).build();
 executionRepository.store(pipeline);
 try {
  executionLauncher.start(pipeline);
 } catch (Throwable t) {
  log.error("Failed to start pipeline", t);
  handleStartupFailure(pipeline, t);
  throw new RuntimeException("Failed to start the canary analysis pipeline execution");
 }
 return CanaryAnalysisExecutionResponse.builder().canaryAnalysisExecutionId(pipeline.getId()).build();
}

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

@Override
 public int compare(Execution a, Execution b) {
  return a.getId().compareTo(b.getId());
 }
},

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

@Override
 public int compare(Execution a, Execution b) {
  Long aBuildTime = Optional.ofNullable(a.getBuildTime()).orElse(0L);
  Long bBuildTime = Optional.ofNullable(b.getBuildTime()).orElse(0L);
  int buildCompare = aBuildTime.compareTo(bBuildTime);
  if (buildCompare == 0) {
   return a.getId().compareTo(b.getId());
  }
  return buildCompare;
 }
};

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

private Execution handleStartupFailure(Execution execution, Throwable failure) {
 final String canceledBy = "system";
 final String reason = "Failed on startup: " + failure.getMessage();
 final ExecutionStatus status = ExecutionStatus.TERMINAL;
 log.error("Failed to start {} {}", execution.getType(), execution.getId(), failure);
 executionRepository.updateStatus(execution.getType(), execution.getId(), status);
 executionRepository.cancel(execution.getType(), execution.getId(), canceledBy, reason);
 return executionRepository.retrieve(execution.getType(), execution.getId());
}

代码示例来源: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());
}

相关文章