/** * Create an instance of {@link EmrHiveStepAddRequest } * */ public EmrHiveStepAddRequest createEmrHiveStepAddRequest() { return new EmrHiveStepAddRequest(); }
@Override public void setRequestStepName(Object stepRequest, String stepName) { ((EmrHiveStepAddRequest) stepRequest).setStepName(stepName); }
@Override public String getRequestAccountId(Object stepRequest) { return ((EmrHiveStepAddRequest) stepRequest).getAccountId(); }
public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) { final Object draftCopy = ((target == null)?createNewInstance():target); if (draftCopy instanceof EmrHiveStepAddRequest) { final EmrHiveStepAddRequest copy = ((EmrHiveStepAddRequest) draftCopy); if (namespaceShouldBeCopiedAndSet == Boolean.TRUE) { String sourceNamespace; sourceNamespace = this.getNamespace(); String copyNamespace = ((String) strategy.copy(LocatorUtils.property(locator, "namespace", sourceNamespace), sourceNamespace, (this.namespace!= null))); copy.setNamespace(copyNamespace); } else { if (namespaceShouldBeCopiedAndSet == Boolean.FALSE) { if (emrClusterDefinitionNameShouldBeCopiedAndSet == Boolean.TRUE) { String sourceEmrClusterDefinitionName; sourceEmrClusterDefinitionName = this.getEmrClusterDefinitionName(); String copyEmrClusterDefinitionName = ((String) strategy.copy(LocatorUtils.property(locator, "emrClusterDefinitionName", sourceEmrClusterDefinitionName), sourceEmrClusterDefinitionName, (this.emrClusterDefinitionName!= null))); copy.setEmrClusterDefinitionName(copyEmrClusterDefinitionName); } else { if (emrClusterDefinitionNameShouldBeCopiedAndSet == Boolean.FALSE) { if (emrClusterNameShouldBeCopiedAndSet == Boolean.TRUE) { String sourceEmrClusterName; sourceEmrClusterName = this.getEmrClusterName(); String copyEmrClusterName = ((String) strategy.copy(LocatorUtils.property(locator, "emrClusterName", sourceEmrClusterName), sourceEmrClusterName, (this.emrClusterName!= null))); copy.setEmrClusterName(copyEmrClusterName); } else { if (emrClusterNameShouldBeCopiedAndSet == Boolean.FALSE) { if (stepNameShouldBeCopiedAndSet == Boolean.TRUE) {
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { theNamespace = this.getNamespace(); strategy.appendField(locator, this, "namespace", buffer, theNamespace, (this.namespace!= null)); theEmrClusterDefinitionName = this.getEmrClusterDefinitionName(); strategy.appendField(locator, this, "emrClusterDefinitionName", buffer, theEmrClusterDefinitionName, (this.emrClusterDefinitionName!= null)); theEmrClusterName = this.getEmrClusterName(); strategy.appendField(locator, this, "emrClusterName", buffer, theEmrClusterName, (this.emrClusterName!= null)); theStepName = this.getStepName(); strategy.appendField(locator, this, "stepName", buffer, theStepName, (this.stepName!= null)); theScriptLocation = this.getScriptLocation(); strategy.appendField(locator, this, "scriptLocation", buffer, theScriptLocation, (this.scriptLocation!= null)); theScriptArguments = ((this.scriptArguments!= null)?this.getScriptArguments():null); strategy.appendField(locator, this, "scriptArguments", buffer, theScriptArguments, (this.scriptArguments!= null)); theContinueOnError = this.isContinueOnError(); strategy.appendField(locator, this, "continueOnError", buffer, theContinueOnError, (this.continueOnError!= null)); theEmrClusterId = this.getEmrClusterId(); strategy.appendField(locator, this, "emrClusterId", buffer, theEmrClusterId, (this.emrClusterId!= null)); theAccountId = this.getAccountId(); strategy.appendField(locator, this, "accountId", buffer, theAccountId, (this.accountId!= null));
@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; }
emrSteps.add(shellStepRequest); EmrHiveStepAddRequest hiveStepRequest = new EmrHiveStepAddRequest(); List<String> scriptArgs1 = new ArrayList<>(); scriptArgs1.add("arg2=sampleArg"); scriptArgs1.add("arg1=tables"); hiveStepRequest.setStepName("Test Hive"); hiveStepRequest.setScriptLocation("s3://test-bucket-managed/app-a/test/test_hive.hql"); hiveStepRequest.setScriptArguments(scriptArgs1); emrSteps.add(hiveStepRequest);
@Override public void executeImpl(DelegateExecution execution) throws Exception { // Create the request. EmrHiveStepAddRequest request = new EmrHiveStepAddRequest(); populateCommonParams(request, execution); request.setScriptLocation(getScriptLocation(execution)); request.setScriptArguments(getScriptArguments(execution)); addEmrStepAndSetWorkflowVariables(request, execution); } }
@Override public String getRequestEmrClusterName(Object stepRequest) { return ((EmrHiveStepAddRequest) stepRequest).getEmrClusterName(); }
@Override public String getRequestEmrClusterId(Object stepRequest) { return ((EmrHiveStepAddRequest) stepRequest).getEmrClusterId(); }
@Override public String getRequestEmrClusterDefinitionName(Object stepRequest) { return ((EmrHiveStepAddRequest) stepRequest).getEmrClusterDefinitionName(); }
@Override public String getRequestNamespace(Object stepRequest) { return ((EmrHiveStepAddRequest) stepRequest).getNamespace(); }
public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) { final Object draftCopy = ((target == null)?createNewInstance():target); if (draftCopy instanceof EmrHiveStepAddRequest) { final EmrHiveStepAddRequest copy = ((EmrHiveStepAddRequest) draftCopy); if (namespaceShouldBeCopiedAndSet == Boolean.TRUE) { String sourceNamespace; sourceNamespace = this.getNamespace(); String copyNamespace = ((String) strategy.copy(LocatorUtils.property(locator, "namespace", sourceNamespace), sourceNamespace, (this.namespace!= null))); copy.setNamespace(copyNamespace); } else { if (namespaceShouldBeCopiedAndSet == Boolean.FALSE) { if (emrClusterDefinitionNameShouldBeCopiedAndSet == Boolean.TRUE) { String sourceEmrClusterDefinitionName; sourceEmrClusterDefinitionName = this.getEmrClusterDefinitionName(); String copyEmrClusterDefinitionName = ((String) strategy.copy(LocatorUtils.property(locator, "emrClusterDefinitionName", sourceEmrClusterDefinitionName), sourceEmrClusterDefinitionName, (this.emrClusterDefinitionName!= null))); copy.setEmrClusterDefinitionName(copyEmrClusterDefinitionName); } else { if (emrClusterDefinitionNameShouldBeCopiedAndSet == Boolean.FALSE) { if (emrClusterNameShouldBeCopiedAndSet == Boolean.TRUE) { String sourceEmrClusterName; sourceEmrClusterName = this.getEmrClusterName(); String copyEmrClusterName = ((String) strategy.copy(LocatorUtils.property(locator, "emrClusterName", sourceEmrClusterName), sourceEmrClusterName, (this.emrClusterName!= null))); copy.setEmrClusterName(copyEmrClusterName); } else { if (emrClusterNameShouldBeCopiedAndSet == Boolean.FALSE) { if (stepNameShouldBeCopiedAndSet == Boolean.TRUE) {
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { theNamespace = this.getNamespace(); strategy.appendField(locator, this, "namespace", buffer, theNamespace, (this.namespace!= null)); theEmrClusterDefinitionName = this.getEmrClusterDefinitionName(); strategy.appendField(locator, this, "emrClusterDefinitionName", buffer, theEmrClusterDefinitionName, (this.emrClusterDefinitionName!= null)); theEmrClusterName = this.getEmrClusterName(); strategy.appendField(locator, this, "emrClusterName", buffer, theEmrClusterName, (this.emrClusterName!= null)); theStepName = this.getStepName(); strategy.appendField(locator, this, "stepName", buffer, theStepName, (this.stepName!= null)); theScriptLocation = this.getScriptLocation(); strategy.appendField(locator, this, "scriptLocation", buffer, theScriptLocation, (this.scriptLocation!= null)); theScriptArguments = ((this.scriptArguments!= null)?this.getScriptArguments():null); strategy.appendField(locator, this, "scriptArguments", buffer, theScriptArguments, (this.scriptArguments!= null)); theContinueOnError = this.isContinueOnError(); strategy.appendField(locator, this, "continueOnError", buffer, theContinueOnError, (this.continueOnError!= null)); theEmrClusterId = this.getEmrClusterId(); strategy.appendField(locator, this, "emrClusterId", buffer, theEmrClusterId, (this.emrClusterId!= null)); theAccountId = this.getAccountId(); strategy.appendField(locator, this, "accountId", buffer, theAccountId, (this.accountId!= null));
@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; }
emrSteps.add(shellStepRequest); EmrHiveStepAddRequest hiveStepRequest = new EmrHiveStepAddRequest(); List<String> scriptArgs1 = new ArrayList<>(); scriptArgs1.add("arg2=sampleArg"); scriptArgs1.add("arg1=tables"); hiveStepRequest.setStepName("Test Hive"); hiveStepRequest.setScriptLocation("s3://test-bucket-managed/app-a/test/test_hive.hql"); hiveStepRequest.setScriptArguments(scriptArgs1); emrSteps.add(hiveStepRequest);
@Override public void executeImpl(DelegateExecution execution) throws Exception { // Create the request. EmrHiveStepAddRequest request = new EmrHiveStepAddRequest(); populateCommonParams(request, execution); request.setScriptLocation(getScriptLocation(execution)); request.setScriptArguments(getScriptArguments(execution)); addEmrStepAndSetWorkflowVariables(request, execution); } }
@Override public String getRequestEmrClusterName(Object stepRequest) { return ((EmrHiveStepAddRequest) stepRequest).getEmrClusterName(); }
@Override public String getRequestEmrClusterId(Object stepRequest) { return ((EmrHiveStepAddRequest) stepRequest).getEmrClusterId(); }
@Override public String getRequestEmrClusterDefinitionName(Object stepRequest) { return ((EmrHiveStepAddRequest) stepRequest).getEmrClusterDefinitionName(); }