/** * <p> * The identifier of the cluster with steps to describe. * </p> * * @param clusterId * The identifier of the cluster with steps to describe. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeStepRequest withClusterId(String clusterId) { setClusterId(clusterId); return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getClusterId() == null) ? 0 : getClusterId().hashCode()); hashCode = prime * hashCode + ((getStepId() == null) ? 0 : getStepId().hashCode()); return hashCode; }
/** * <p> * The identifier of the step to describe. * </p> * * @param stepId * The identifier of the step to describe. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeStepRequest withStepId(String stepId) { setStepId(stepId); return this; }
@Override public Step getClusterStep(String clusterId, String stepId, AwsParamsDto awsParamsDto) { DescribeStepRequest describeStepRequest = new DescribeStepRequest().withClusterId(clusterId).withStepId(stepId); return emrOperations.describeStepRequest(getEmrClient(awsParamsDto), describeStepRequest).getStep(); }
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; }
DescribeStepRequest describe = new DescribeStepRequest().withStepId(id.get(0)); describe.setClusterId(rb.getString("jobflowID")); describe.setRequestCredentials(awsCreds); DescribeStepResult res = emr.describeStep(describe); StepStatus status = res.getStep().getStatus();
@Override public Step getClusterStep(String clusterId, String stepId, AwsParamsDto awsParamsDto) { DescribeStepRequest describeStepRequest = new DescribeStepRequest().withClusterId(clusterId).withStepId(stepId); return emrOperations.describeStepRequest(getEmrClient(awsParamsDto), describeStepRequest).getStep(); }
}); Step lastStep = emr.describeStep(new DescribeStepRequest() .withClusterId(submission.clusterId()) .withStepId(lastStepId)) .getStep();
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeStepRequest == false) return false; DescribeStepRequest other = (DescribeStepRequest) obj; if (other.getClusterId() == null ^ this.getClusterId() == null) return false; if (other.getClusterId() != null && other.getClusterId().equals(this.getClusterId()) == false) return false; if (other.getStepId() == null ^ this.getStepId() == null) return false; if (other.getStepId() != null && other.getStepId().equals(this.getStepId()) == false) return false; return true; }
/** * <p> * The identifier of the cluster with steps to describe. * </p> * * @param clusterId * The identifier of the cluster with steps to describe. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeStepRequest withClusterId(String clusterId) { setClusterId(clusterId); return this; }
/** * <p> * The identifier of the step to describe. * </p> * * @param stepId * The identifier of the step to describe. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeStepRequest withStepId(String stepId) { setStepId(stepId); return this; }
/** * 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 (getClusterId() != null) sb.append("ClusterId: ").append(getClusterId()).append(","); if (getStepId() != null) sb.append("StepId: ").append(getStepId()); sb.append("}"); return sb.toString(); }
/** * Marshall the given parameter object. */ public void marshall(DescribeStepRequest describeStepRequest, ProtocolMarshaller protocolMarshaller) { if (describeStepRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeStepRequest.getClusterId(), CLUSTERID_BINDING); protocolMarshaller.marshall(describeStepRequest.getStepId(), STEPID_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getClusterId() == null) ? 0 : getClusterId().hashCode()); hashCode = prime * hashCode + ((getStepId() == null) ? 0 : getStepId().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeStepRequest == false) return false; DescribeStepRequest other = (DescribeStepRequest) obj; if (other.getClusterId() == null ^ this.getClusterId() == null) return false; if (other.getClusterId() != null && other.getClusterId().equals(this.getClusterId()) == false) return false; if (other.getStepId() == null ^ this.getStepId() == null) return false; if (other.getStepId() != null && other.getStepId().equals(this.getStepId()) == 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 (getClusterId() != null) sb.append("ClusterId: ").append(getClusterId()).append(","); if (getStepId() != null) sb.append("StepId: ").append(getStepId()); sb.append("}"); return sb.toString(); }
/** * Marshall the given parameter object. */ public void marshall(DescribeStepRequest describeStepRequest, ProtocolMarshaller protocolMarshaller) { if (describeStepRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeStepRequest.getClusterId(), CLUSTERID_BINDING); protocolMarshaller.marshall(describeStepRequest.getStepId(), STEPID_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
@Override public DescribeStepResult answer(InvocationOnMock invocation) throws Throwable { DescribeStepRequest describeStepRequest = invocation.getArgument(1); assertEquals(clusterId, describeStepRequest.getClusterId()); assertEquals(stepId, describeStepRequest.getStepId()); DescribeStepResult describeStepResult = new DescribeStepResult(); describeStepResult.setStep(expectedStep); return describeStepResult; } });
@Override public DescribeStepResult describeStepRequest(AmazonElasticMapReduceClient emrClient, DescribeStepRequest describeStepRequest) { MockEmrJobFlow cluster = getClusterById(describeStepRequest.getClusterId()); if (cluster == null) { throw new AmazonServiceException("No cluster found with jobFlowId: " + describeStepRequest.getClusterId()); } Step stepResult = null; // Add steps that are in these states for (MockEmrJobFlow step : cluster.getSteps()) { if (describeStepRequest.getStepId().equalsIgnoreCase(step.getJobFlowId())) { HadoopStepConfig hadoopStepConfig = new HadoopStepConfig().withJar(step.getJarLocation()); stepResult = new Step().withId(step.getJobFlowId()).withName(step.getJobFlowName()).withStatus(new StepStatus().withState(step.getStatus())) .withConfig(hadoopStepConfig); if (stepResult.getName().equalsIgnoreCase(MOCK_STEP_WITHOUT_ID_NAME)) { stepResult.setId(null); } break; } } return new DescribeStepResult().withStep(stepResult); }