/** * Create an instance of {@link EmrPigStep } * */ public EmrPigStep createEmrPigStep() { return new EmrPigStep(); }
@Override public String getStepId(Object step) { return ((EmrPigStep) step).getId(); }
public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) { final Object draftCopy = ((target == null)?createNewInstance():target); if (draftCopy instanceof EmrPigStep) { final EmrPigStep copy = ((EmrPigStep) draftCopy); if (idShouldBeCopiedAndSet == Boolean.TRUE) { String sourceId; sourceId = this.getId(); String copyId = ((String) strategy.copy(LocatorUtils.property(locator, "id", sourceId), sourceId, (this.id!= null))); copy.setId(copyId); } else { if (idShouldBeCopiedAndSet == Boolean.FALSE) { 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) {
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { theId = this.getId(); strategy.appendField(locator, this, "id", buffer, theId, (this.id!= null)); 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));
@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; }
EmrPigStep pigStep = new EmrPigStep(NAMESPACE, EMR_CLUSTER_DEFINITION_NAME, request.getEmrClusterName(), null, null, null, null, null, null); pigStep.setStepName("Test Pig"); pigStep.setContinueOnError(true); pigStep.setScriptLocation("s3://test-bucket-managed/app-a/test/test_pig.pig");
@Override public StepConfig getEmrStepConfig(Object step) { EmrPigStep pigStep = (EmrPigStep) step; // Default ActionOnFailure is to cancel the execution and wait ActionOnFailure actionOnFailure = ActionOnFailure.CANCEL_AND_WAIT; if (pigStep.isContinueOnError() != null && pigStep.isContinueOnError()) { // Override based on user input actionOnFailure = ActionOnFailure.CONTINUE; } // If there are no arguments to hive script if (CollectionUtils.isEmpty(pigStep.getScriptArguments())) { // Just build the StepConfig object and return return new StepConfig().withName(pigStep.getStepName().trim()).withActionOnFailure(actionOnFailure) .withHadoopJarStep(new StepFactory().newRunPigScriptStep(pigStep.getScriptLocation().trim())); } // If there are arguments specified else { return new StepConfig().withName(pigStep.getStepName().trim()).withActionOnFailure(actionOnFailure).withHadoopJarStep(new StepFactory() .newRunPigScriptStep(pigStep.getScriptLocation().trim(), pigStep.getScriptArguments().toArray(new String[pigStep.getScriptArguments().size()]))); } }
public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) { final Object draftCopy = ((target == null)?createNewInstance():target); if (draftCopy instanceof EmrPigStep) { final EmrPigStep copy = ((EmrPigStep) draftCopy); if (idShouldBeCopiedAndSet == Boolean.TRUE) { String sourceId; sourceId = this.getId(); String copyId = ((String) strategy.copy(LocatorUtils.property(locator, "id", sourceId), sourceId, (this.id!= null))); copy.setId(copyId); } else { if (idShouldBeCopiedAndSet == Boolean.FALSE) { 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) {
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { theId = this.getId(); strategy.appendField(locator, this, "id", buffer, theId, (this.id!= null)); 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));
@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; }
@Override public StepConfig getEmrStepConfig(Object step) { EmrPigStep pigStep = (EmrPigStep) step; // Default ActionOnFailure is to cancel the execution and wait ActionOnFailure actionOnFailure = ActionOnFailure.CANCEL_AND_WAIT; if (pigStep.isContinueOnError() != null && pigStep.isContinueOnError()) { // Override based on user input actionOnFailure = ActionOnFailure.CONTINUE; } // If there are no arguments to hive script if (CollectionUtils.isEmpty(pigStep.getScriptArguments())) { // Just build the StepConfig object and return return new StepConfig().withName(pigStep.getStepName().trim()).withActionOnFailure(actionOnFailure) .withHadoopJarStep(new StepFactory().newRunPigScriptStep(pigStep.getScriptLocation().trim())); } // If there are arguments specified else { return new StepConfig().withName(pigStep.getStepName().trim()).withActionOnFailure(actionOnFailure).withHadoopJarStep(new StepFactory() .newRunPigScriptStep(pigStep.getScriptLocation().trim(), pigStep.getScriptArguments().toArray(new String[pigStep.getScriptArguments().size()]))); } }
public Object copyTo(ObjectLocator locator, Object target, CopyStrategy2 strategy) { final Object draftCopy = ((target == null)?createNewInstance():target); if (draftCopy instanceof EmrPigStep) { final EmrPigStep copy = ((EmrPigStep) draftCopy); if (idShouldBeCopiedAndSet == Boolean.TRUE) { String sourceId; sourceId = this.getId(); String copyId = ((String) strategy.copy(LocatorUtils.property(locator, "id", sourceId), sourceId, (this.id!= null))); copy.setId(copyId); } else { if (idShouldBeCopiedAndSet == Boolean.FALSE) { 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) {
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy2 strategy) { theId = this.getId(); strategy.appendField(locator, this, "id", buffer, theId, (this.id!= null)); 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));
/** * Create an instance of {@link EmrPigStep } * */ public EmrPigStep createEmrPigStep() { return new EmrPigStep(); }
@Override public String getStepId(Object step) { return ((EmrPigStep) step).getId(); }
lhsId = this.getId(); String rhsId; rhsId = that.getId(); if (!strategy.equals(LocatorUtils.property(thisLocator, "id", lhsId), LocatorUtils.property(thatLocator, "id", rhsId), lhsId, rhsId, (this.id!= null), (that.id!= null))) { return false; lhsNamespace = this.getNamespace(); String rhsNamespace; rhsNamespace = that.getNamespace(); if (!strategy.equals(LocatorUtils.property(thisLocator, "namespace", lhsNamespace), LocatorUtils.property(thatLocator, "namespace", rhsNamespace), lhsNamespace, rhsNamespace, (this.namespace!= null), (that.namespace!= null))) { return false; lhsEmrClusterDefinitionName = this.getEmrClusterDefinitionName(); String rhsEmrClusterDefinitionName; rhsEmrClusterDefinitionName = that.getEmrClusterDefinitionName(); if (!strategy.equals(LocatorUtils.property(thisLocator, "emrClusterDefinitionName", lhsEmrClusterDefinitionName), LocatorUtils.property(thatLocator, "emrClusterDefinitionName", rhsEmrClusterDefinitionName), lhsEmrClusterDefinitionName, rhsEmrClusterDefinitionName, (this.emrClusterDefinitionName!= null), (that.emrClusterDefinitionName!= null))) { return false; lhsEmrClusterName = this.getEmrClusterName(); String rhsEmrClusterName; rhsEmrClusterName = that.getEmrClusterName(); if (!strategy.equals(LocatorUtils.property(thisLocator, "emrClusterName", lhsEmrClusterName), LocatorUtils.property(thatLocator, "emrClusterName", rhsEmrClusterName), lhsEmrClusterName, rhsEmrClusterName, (this.emrClusterName!= null), (that.emrClusterName!= null))) { return false; lhsStepName = this.getStepName(); String rhsStepName; rhsStepName = that.getStepName(); if (!strategy.equals(LocatorUtils.property(thisLocator, "stepName", lhsStepName), LocatorUtils.property(thatLocator, "stepName", rhsStepName), lhsStepName, rhsStepName, (this.stepName!= null), (that.stepName!= null))) { return false;
/** * Create an instance of {@link EmrPigStep } * */ public EmrPigStep createEmrPigStep() { return new EmrPigStep(); }
lhsId = this.getId(); String rhsId; rhsId = that.getId(); if (!strategy.equals(LocatorUtils.property(thisLocator, "id", lhsId), LocatorUtils.property(thatLocator, "id", rhsId), lhsId, rhsId, (this.id!= null), (that.id!= null))) { return false; lhsNamespace = this.getNamespace(); String rhsNamespace; rhsNamespace = that.getNamespace(); if (!strategy.equals(LocatorUtils.property(thisLocator, "namespace", lhsNamespace), LocatorUtils.property(thatLocator, "namespace", rhsNamespace), lhsNamespace, rhsNamespace, (this.namespace!= null), (that.namespace!= null))) { return false; lhsEmrClusterDefinitionName = this.getEmrClusterDefinitionName(); String rhsEmrClusterDefinitionName; rhsEmrClusterDefinitionName = that.getEmrClusterDefinitionName(); if (!strategy.equals(LocatorUtils.property(thisLocator, "emrClusterDefinitionName", lhsEmrClusterDefinitionName), LocatorUtils.property(thatLocator, "emrClusterDefinitionName", rhsEmrClusterDefinitionName), lhsEmrClusterDefinitionName, rhsEmrClusterDefinitionName, (this.emrClusterDefinitionName!= null), (that.emrClusterDefinitionName!= null))) { return false; lhsEmrClusterName = this.getEmrClusterName(); String rhsEmrClusterName; rhsEmrClusterName = that.getEmrClusterName(); if (!strategy.equals(LocatorUtils.property(thisLocator, "emrClusterName", lhsEmrClusterName), LocatorUtils.property(thatLocator, "emrClusterName", rhsEmrClusterName), lhsEmrClusterName, rhsEmrClusterName, (this.emrClusterName!= null), (that.emrClusterName!= null))) { return false; lhsStepName = this.getStepName(); String rhsStepName; rhsStepName = that.getStepName(); if (!strategy.equals(LocatorUtils.property(thisLocator, "stepName", lhsStepName), LocatorUtils.property(thatLocator, "stepName", rhsStepName), lhsStepName, rhsStepName, (this.stepName!= null), (that.stepName!= null))) { return false;
public Object createNewInstance() { return new EmrPigStep(); }
theId = this.getId(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "id", theId), currentHashCode, theId, (this.id!= null)); theNamespace = this.getNamespace(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "namespace", theNamespace), currentHashCode, theNamespace, (this.namespace!= null)); theEmrClusterDefinitionName = this.getEmrClusterDefinitionName(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "emrClusterDefinitionName", theEmrClusterDefinitionName), currentHashCode, theEmrClusterDefinitionName, (this.emrClusterDefinitionName!= null)); theEmrClusterName = this.getEmrClusterName(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "emrClusterName", theEmrClusterName), currentHashCode, theEmrClusterName, (this.emrClusterName!= null)); theStepName = this.getStepName(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "stepName", theStepName), currentHashCode, theStepName, (this.stepName!= null)); theScriptLocation = this.getScriptLocation(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "scriptLocation", theScriptLocation), currentHashCode, theScriptLocation, (this.scriptLocation!= null)); theScriptArguments = ((this.scriptArguments!= null)?this.getScriptArguments():null); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "scriptArguments", theScriptArguments), currentHashCode, theScriptArguments, (this.scriptArguments!= null)); theContinueOnError = this.isContinueOnError(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "continueOnError", theContinueOnError), currentHashCode, theContinueOnError, (this.continueOnError!= null)); theEmrClusterId = this.getEmrClusterId(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "emrClusterId", theEmrClusterId), currentHashCode, theEmrClusterId, (this.emrClusterId!= null));