use of com.microsoft.azure.hdinsight.sdk.rest.yarn.rm.App in project azure-tools-for-java by Microsoft.
the class SparkBatchRemoteDebugJob method getSparkDriverHost.
/**
* Get Spark batch job driver host by ID
*
* @return Spark driver node host
* @throws IOException exceptions for the driver host not found
*/
@Override
public String getSparkDriverHost() throws IOException {
String applicationId = this.getSparkJobApplicationId(this.getConnectUri(), this.getBatchId());
App yarnApp = this.getSparkJobYarnApplication(this.getConnectUri(), applicationId);
if (yarnApp.isFinished()) {
throw new UnknownServiceException("The Livy job " + this.getBatchId() + " on yarn is not running.");
}
String driverHttpAddress = yarnApp.getAmHostHttpAddress();
/*
* The sample here is:
* host.domain.com:8900
* or
* 10.0.0.15:30060
*/
String driverHost = this.parseAmHostHttpAddressHost(driverHttpAddress);
if (driverHost == null) {
throw new UnknownServiceException("Bad amHostHttpAddress got from /yarnui/ws/v1/cluster/apps/" + applicationId);
}
return driverHost;
}
Aggregations