Esempio n. 1
0
  @Override
  public void validateAddStepRequest(Object step) {
    EmrHiveStepAddRequest hiveStepRequest = (EmrHiveStepAddRequest) step;

    validateStepName(hiveStepRequest.getStepName());
    validateScriptLocation(hiveStepRequest.getScriptLocation());
  }
Esempio n. 2
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;
  }
Esempio n. 3
0
 @Override
 public void setRequestStepName(Object stepRequest, String stepName) {
   ((EmrHiveStepAddRequest) stepRequest).setStepName(stepName);
 }
Esempio n. 4
0
 @Override
 public void setRequestNamespace(Object stepRequest, String namespace) {
   ((EmrHiveStepAddRequest) stepRequest).setNamespace(namespace);
 }
Esempio n. 5
0
 @Override
 public void setRequestEmrClusterName(Object stepRequest, String clusterName) {
   ((EmrHiveStepAddRequest) stepRequest).setEmrClusterName(clusterName);
 }
Esempio n. 6
0
 @Override
 public void setRequestEmrClusterId(Object stepRequest, String emrClusterId) {
   ((EmrHiveStepAddRequest) stepRequest).setEmrClusterId(emrClusterId);
 }
Esempio n. 7
0
 @Override
 public void setRequestContinueOnError(Object stepRequest, Boolean continueOnError) {
   ((EmrHiveStepAddRequest) stepRequest).setContinueOnError(continueOnError);
 }