Пример #1
0
  @Override
  public Object buildResponseFromRequest(Object stepRequest) {
    EmrHiveStepAddRequest emrHiveStepAddRequest = (EmrHiveStepAddRequest) stepRequest;
    EmrHiveStep step = new EmrHiveStep();

    step.setNamespace(emrHiveStepAddRequest.getNamespace());
    step.setEmrClusterDefinitionName(emrHiveStepAddRequest.getEmrClusterDefinitionName());
    step.setEmrClusterName(emrHiveStepAddRequest.getEmrClusterName());

    step.setStepName(emrHiveStepAddRequest.getStepName().trim());
    step.setScriptLocation(
        emrHiveStepAddRequest
            .getScriptLocation()
            .trim()
            .replaceAll(getS3ManagedReplaceString(), emrHelper.getS3StagingLocation()));
    // Add the script arguments
    if (!CollectionUtils.isEmpty(emrHiveStepAddRequest.getScriptArguments())) {
      List<String> scriptArguments = new ArrayList<>();
      step.setScriptArguments(scriptArguments);
      for (String argument : emrHiveStepAddRequest.getScriptArguments()) {
        scriptArguments.add(argument.trim());
      }
    }
    step.setContinueOnError(emrHiveStepAddRequest.isContinueOnError());

    return step;
  }
Пример #2
0
  @Override
  public void validateAddStepRequest(Object step) {
    EmrHiveStepAddRequest hiveStepRequest = (EmrHiveStepAddRequest) step;

    validateStepName(hiveStepRequest.getStepName());
    validateScriptLocation(hiveStepRequest.getScriptLocation());
  }