use of com.microsoft.azure.hdinsight.sdk.common.HttpResponse in project azure-tools-for-java by Microsoft.
the class SparkBatchRemoteDebugJob method createBatchSparkJobWithDriverDebugging.
/**
* Create a batch Spark job with driver debugging enabled
*
* @return the current instance for chain calling
* @throws IOException the exceptions for networking connection issues related
* @throws DebugParameterDefinedException the exception for debug option already defined in Spark submission parameter
*/
@Override
public SparkBatchRemoteDebugJob createBatchSparkJobWithDriverDebugging() throws IOException, DebugParameterDefinedException {
// Submit the batch job
HttpResponse httpResponse = this.getSubmission().createBatchSparkJob(this.getConnectUri().toString(), this.getSubmissionParameter());
// Get the batch ID from response and save it
if (httpResponse.getCode() >= 200 && httpResponse.getCode() < 300) {
SparkSubmitResponse jobResp = ObjectConvertUtils.convertJsonToObject(httpResponse.getMessage(), SparkSubmitResponse.class).orElseThrow(() -> new UnknownServiceException("Bad spark job response: " + httpResponse.getMessage()));
this.setBatchId(jobResp.getId());
}
return this;
}
Aggregations