/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getId() != null) sb.append("Id: ").append(getId()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getConfig() != null) sb.append("Config: ").append(getConfig()).append(","); if (getActionOnFailure() != null) sb.append("ActionOnFailure: ").append(getActionOnFailure()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getConfig() == null) ? 0 : getConfig().hashCode()); hashCode = prime * hashCode + ((getActionOnFailure() == null) ? 0 : getActionOnFailure().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); return hashCode; }
/** * Marshall the given parameter object. */ public void marshall(Step step, ProtocolMarshaller protocolMarshaller) { if (step == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(step.getId(), ID_BINDING); protocolMarshaller.marshall(step.getName(), NAME_BINDING); protocolMarshaller.marshall(step.getConfig(), CONFIG_BINDING); protocolMarshaller.marshall(step.getActionOnFailure(), ACTIONONFAILURE_BINDING); protocolMarshaller.marshall(step.getStatus(), STATUS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
if (other.getActionOnFailure() != null && other.getActionOnFailure().equals(this.getActionOnFailure()) == false) return false; if (other.getStatus() == null ^ this.getStatus() == null) return false; if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false; return true;
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getId() != null) sb.append("Id: ").append(getId()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getConfig() != null) sb.append("Config: ").append(getConfig()).append(","); if (getActionOnFailure() != null) sb.append("ActionOnFailure: ").append(getActionOnFailure()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getConfig() == null) ? 0 : getConfig().hashCode()); hashCode = prime * hashCode + ((getActionOnFailure() == null) ? 0 : getActionOnFailure().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); return hashCode; }
/** * Marshall the given parameter object. */ public void marshall(Step step, ProtocolMarshaller protocolMarshaller) { if (step == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(step.getId(), ID_BINDING); protocolMarshaller.marshall(step.getName(), NAME_BINDING); protocolMarshaller.marshall(step.getConfig(), CONFIG_BINDING); protocolMarshaller.marshall(step.getActionOnFailure(), ACTIONONFAILURE_BINDING); protocolMarshaller.marshall(step.getStatus(), STATUS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
if (other.getActionOnFailure() != null && other.getActionOnFailure().equals(this.getActionOnFailure()) == false) return false; if (other.getStatus() == null ^ this.getStatus() == null) return false; if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false; return true;
private String getActualStepState() { String stepState = null; DescribeStepRequest describeStepRequest = new DescribeStepRequest(); describeStepRequest.setClusterId( hadoopJobFlowId ); describeStepRequest.setStepId( stepId ); DescribeStepResult describeStepResult = emrClient.describeStep( describeStepRequest ); if ( describeStepResult != null ) { stepState = describeStepResult.getStep().getStatus().getState(); } return stepState; }
.getStep(); String stepState = lastStep.getStatus().getState();
/** * Builds EmrStep object from the EMR step. Fills in details if verbose=true. * * @param step The step * @param verbose The verbose flag * * @return EmrStep */ private EmrStep buildEmrStepFromAwsStep(Step step, boolean verbose) { EmrStep emrStep = new EmrStep(); emrStep.setId(step.getId()); emrStep.setStepName(step.getName()); emrStep.setStatus(step.getStatus().getState()); if (verbose) { emrStep.setJarLocation(step.getConfig().getJar()); emrStep.setMainClass(step.getConfig().getMainClass()); emrStep.setScriptArguments(step.getConfig().getArgs()); emrStep.setContinueOnError(step.getActionOnFailure()); } return emrStep; }
/** * Builds EmrStep object from the EMR step. Fills in details if verbose=true. * * @param step The step * @param verbose The verbose flag * * @return EmrStep */ private EmrStep buildEmrStepFromAwsStep(Step step, boolean verbose) { EmrStep emrStep = new EmrStep(); emrStep.setId(step.getId()); emrStep.setStepName(step.getName()); emrStep.setStatus(step.getStatus().getState()); if (verbose) { emrStep.setJarLocation(step.getConfig().getJar()); emrStep.setMainClass(step.getConfig().getMainClass()); emrStep.setScriptArguments(step.getConfig().getArgs()); emrStep.setContinueOnError(step.getActionOnFailure()); } return emrStep; }