/** * 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 (getState() != null) sb.append("State: ").append(getState()).append(","); if (getStateChangeReason() != null) sb.append("StateChangeReason: ").append(getStateChangeReason()).append(","); if (getFailureDetails() != null) sb.append("FailureDetails: ").append(getFailureDetails()).append(","); if (getTimeline() != null) sb.append("Timeline: ").append(getTimeline()); sb.append("}"); return sb.toString(); }
List<String> id = result.getStepIds(); DescribeStepResult res = client.describeStep(new DescribeStepRequest().withStepId(id.get(0))); StepStatus status = res.getStep().getStatus(); String stas = status.getState();
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode()); hashCode = prime * hashCode + ((getStateChangeReason() == null) ? 0 : getStateChangeReason().hashCode()); hashCode = prime * hashCode + ((getFailureDetails() == null) ? 0 : getFailureDetails().hashCode()); hashCode = prime * hashCode + ((getTimeline() == null) ? 0 : getTimeline().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof StepStatus == false) return false; StepStatus other = (StepStatus) obj; if (other.getState() == null ^ this.getState() == null) return false; if (other.getState() != null && other.getState().equals(this.getState()) == false) return false; if (other.getStateChangeReason() == null ^ this.getStateChangeReason() == null) return false; if (other.getStateChangeReason() != null && other.getStateChangeReason().equals(this.getStateChangeReason()) == false) return false; if (other.getFailureDetails() == null ^ this.getFailureDetails() == null) return false; if (other.getFailureDetails() != null && other.getFailureDetails().equals(this.getFailureDetails()) == false) return false; if (other.getTimeline() == null ^ this.getTimeline() == null) return false; if (other.getTimeline() != null && other.getTimeline().equals(this.getTimeline()) == 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; }
/** * Marshall the given parameter object. */ public void marshall(StepStatus stepStatus, ProtocolMarshaller protocolMarshaller) { if (stepStatus == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(stepStatus.getState(), STATE_BINDING); protocolMarshaller.marshall(stepStatus.getStateChangeReason(), STATECHANGEREASON_BINDING); protocolMarshaller.marshall(stepStatus.getFailureDetails(), FAILUREDETAILS_BINDING); protocolMarshaller.marshall(stepStatus.getTimeline(), TIMELINE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
/** * Builds EmrStep object from the EMR StepSummary. Fills in details if verbose=true. */ private EmrStep buildEmrStepFromAwsStepSummary(StepSummary stepSummary) { EmrStep emrStep = new EmrStep(); emrStep.setId(stepSummary.getId()); emrStep.setStepName(stepSummary.getName()); emrStep.setStatus(stepSummary.getStatus().getState()); return emrStep; }
/** * 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 (getState() != null) sb.append("State: ").append(getState()).append(","); if (getStateChangeReason() != null) sb.append("StateChangeReason: ").append(getStateChangeReason()).append(","); if (getFailureDetails() != null) sb.append("FailureDetails: ").append(getFailureDetails()).append(","); if (getTimeline() != null) sb.append("Timeline: ").append(getTimeline()); sb.append("}"); return sb.toString(); }
/** * Builds EmrStep object from the EMR StepSummary. Fills in details if verbose=true. */ private EmrStep buildEmrStepFromAwsStepSummary(StepSummary stepSummary) { EmrStep emrStep = new EmrStep(); emrStep.setId(stepSummary.getId()); emrStep.setStepName(stepSummary.getName()); emrStep.setStatus(stepSummary.getStatus().getState()); return emrStep; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode()); hashCode = prime * hashCode + ((getStateChangeReason() == null) ? 0 : getStateChangeReason().hashCode()); hashCode = prime * hashCode + ((getFailureDetails() == null) ? 0 : getFailureDetails().hashCode()); hashCode = prime * hashCode + ((getTimeline() == null) ? 0 : getTimeline().hashCode()); return hashCode; }
/** * Builds EmrStep object from the EMR step. Fills in details if verbose=true. * * @param stepSummary The step summary * @param verbose The verbose flag * * @return EmrStep */ private EmrStep buildEmrStepFromAwsStep(StepSummary stepSummary, boolean verbose) { EmrStep emrStep = new EmrStep(); emrStep.setId(stepSummary.getId()); emrStep.setStepName(stepSummary.getName()); emrStep.setStatus(stepSummary.getStatus().getState()); if (verbose) { emrStep.setJarLocation(stepSummary.getConfig().getJar()); emrStep.setMainClass(stepSummary.getConfig().getMainClass()); emrStep.setScriptArguments(stepSummary.getConfig().getArgs()); emrStep.setContinueOnError(stepSummary.getActionOnFailure()); } return emrStep; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof StepStatus == false) return false; StepStatus other = (StepStatus) obj; if (other.getState() == null ^ this.getState() == null) return false; if (other.getState() != null && other.getState().equals(this.getState()) == false) return false; if (other.getStateChangeReason() == null ^ this.getStateChangeReason() == null) return false; if (other.getStateChangeReason() != null && other.getStateChangeReason().equals(this.getStateChangeReason()) == false) return false; if (other.getFailureDetails() == null ^ this.getFailureDetails() == null) return false; if (other.getFailureDetails() != null && other.getFailureDetails().equals(this.getFailureDetails()) == false) return false; if (other.getTimeline() == null ^ this.getTimeline() == null) return false; if (other.getTimeline() != null && other.getTimeline().equals(this.getTimeline()) == false) return false; return true; }
/** * Builds EmrStep object from the EMR step. Fills in details if verbose=true. * * @param stepSummary The step summary * @param verbose The verbose flag * * @return EmrStep */ private EmrStep buildEmrStepFromAwsStep(StepSummary stepSummary, boolean verbose) { EmrStep emrStep = new EmrStep(); emrStep.setId(stepSummary.getId()); emrStep.setStepName(stepSummary.getName()); emrStep.setStatus(stepSummary.getStatus().getState()); if (verbose) { emrStep.setJarLocation(stepSummary.getConfig().getJar()); emrStep.setMainClass(stepSummary.getConfig().getMainClass()); emrStep.setScriptArguments(stepSummary.getConfig().getArgs()); emrStep.setContinueOnError(stepSummary.getActionOnFailure()); } return emrStep; }
/** * Marshall the given parameter object. */ public void marshall(StepStatus stepStatus, ProtocolMarshaller protocolMarshaller) { if (stepStatus == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(stepStatus.getState(), STATE_BINDING); protocolMarshaller.marshall(stepStatus.getStateChangeReason(), STATECHANGEREASON_BINDING); protocolMarshaller.marshall(stepStatus.getFailureDetails(), FAILUREDETAILS_BINDING); protocolMarshaller.marshall(stepStatus.getTimeline(), TIMELINE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
/** * 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; }