Beispiel #1
0
  @Override
  public void validateAddStepRequest(Object step) {
    EmrHiveStepAddRequest hiveStepRequest = (EmrHiveStepAddRequest) step;

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