/** * Create an instance of {@link EmrPigStepAddRequest } * */ public EmrPigStepAddRequest createEmrPigStepAddRequest() { return new EmrPigStepAddRequest(); }
@Override public void setRequestStepName(Object stepRequest, String stepName) { ((EmrPigStepAddRequest) stepRequest).setStepName(stepName); }
@Override public String getRequestAccountId(Object stepRequest) { return ((EmrPigStepAddRequest) stepRequest).getAccountId(); }
public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) { final Object draftCopy = ((target == null)?createNewInstance():target); if (draftCopy instanceof EmrPigStepAddRequest) { final EmrPigStepAddRequest copy = ((EmrPigStepAddRequest) 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) { EmrPigStepAddRequest emrPigStepAddRequest = (EmrPigStepAddRequest) stepRequest; EmrPigStep step = new EmrPigStep(); step.setNamespace(emrPigStepAddRequest.getNamespace()); step.setEmrClusterDefinitionName(emrPigStepAddRequest.getEmrClusterDefinitionName()); step.setEmrClusterName(emrPigStepAddRequest.getEmrClusterName()); step.setStepName(emrPigStepAddRequest.getStepName().trim()); step.setScriptLocation(emrPigStepAddRequest.getScriptLocation().trim().replaceAll(getS3ManagedReplaceString(), emrHelper.getS3StagingLocation())); // Add the script arguments if (!CollectionUtils.isEmpty(emrPigStepAddRequest.getScriptArguments())) { List<String> scriptArguments = new ArrayList<>(); step.setScriptArguments(scriptArguments); for (String argument : emrPigStepAddRequest.getScriptArguments()) { scriptArguments.add(argument.trim()); } } step.setContinueOnError(emrPigStepAddRequest.isContinueOnError()); return step; }
emrSteps.add(hiveStepRequest); EmrPigStepAddRequest pigStepRequest = new EmrPigStepAddRequest(); pigStepRequest.setStepName("Test Pig"); pigStepRequest.setScriptArguments(shellScriptArgs); pigStepRequest.setScriptLocation("s3://test-bucket-managed/app-a/test/test_pig.pig"); emrSteps.add(pigStepRequest);
@Override public void executeImpl(DelegateExecution execution) throws Exception { // Create the request. EmrPigStepAddRequest request = new EmrPigStepAddRequest(); populateCommonParams(request, execution); request.setScriptLocation(getScriptLocation(execution)); request.setScriptArguments(getScriptArguments(execution)); addEmrStepAndSetWorkflowVariables(request,execution); } }
@Override public String getRequestEmrClusterName(Object stepRequest) { return ((EmrPigStepAddRequest) stepRequest).getEmrClusterName(); }
@Override public String getRequestEmrClusterDefinitionName(Object stepRequest) { return ((EmrPigStepAddRequest) stepRequest).getEmrClusterDefinitionName(); }
@Override public String getRequestNamespace(Object stepRequest) { return ((EmrPigStepAddRequest) stepRequest).getNamespace(); }
@Override public String getRequestEmrClusterId(Object stepRequest) { return ((EmrPigStepAddRequest) stepRequest).getEmrClusterId(); }
public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) { final Object draftCopy = ((target == null)?createNewInstance():target); if (draftCopy instanceof EmrPigStepAddRequest) { final EmrPigStepAddRequest copy = ((EmrPigStepAddRequest) 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) { EmrPigStepAddRequest emrPigStepAddRequest = (EmrPigStepAddRequest) stepRequest; EmrPigStep step = new EmrPigStep(); step.setNamespace(emrPigStepAddRequest.getNamespace()); step.setEmrClusterDefinitionName(emrPigStepAddRequest.getEmrClusterDefinitionName()); step.setEmrClusterName(emrPigStepAddRequest.getEmrClusterName()); step.setStepName(emrPigStepAddRequest.getStepName().trim()); step.setScriptLocation(emrPigStepAddRequest.getScriptLocation().trim().replaceAll(getS3ManagedReplaceString(), emrHelper.getS3StagingLocation())); // Add the script arguments if (!CollectionUtils.isEmpty(emrPigStepAddRequest.getScriptArguments())) { List<String> scriptArguments = new ArrayList<>(); step.setScriptArguments(scriptArguments); for (String argument : emrPigStepAddRequest.getScriptArguments()) { scriptArguments.add(argument.trim()); } } step.setContinueOnError(emrPigStepAddRequest.isContinueOnError()); return step; }
emrSteps.add(hiveStepRequest); EmrPigStepAddRequest pigStepRequest = new EmrPigStepAddRequest(); pigStepRequest.setStepName("Test Pig"); pigStepRequest.setScriptArguments(shellScriptArgs); pigStepRequest.setScriptLocation("s3://test-bucket-managed/app-a/test/test_pig.pig"); emrSteps.add(pigStepRequest);
@Override public void executeImpl(DelegateExecution execution) throws Exception { // Create the request. EmrPigStepAddRequest request = new EmrPigStepAddRequest(); populateCommonParams(request, execution); request.setScriptLocation(getScriptLocation(execution)); request.setScriptArguments(getScriptArguments(execution)); addEmrStepAndSetWorkflowVariables(request,execution); } }
@Override public String getRequestEmrClusterName(Object stepRequest) { return ((EmrPigStepAddRequest) stepRequest).getEmrClusterName(); }
@Override public String getRequestEmrClusterDefinitionName(Object stepRequest) { return ((EmrPigStepAddRequest) stepRequest).getEmrClusterDefinitionName(); }
@Override public String getRequestNamespace(Object stepRequest) { return ((EmrPigStepAddRequest) stepRequest).getNamespace(); }