Search in sources :

Example 1 with Executor

use of com.microsoft.azure.hdinsight.sdk.rest.spark.executor.Executor in project azure-tools-for-java by Microsoft.

the class SparkRestUtil method getAllExecutorFromApp.

public static List<Executor> getAllExecutorFromApp(@NotNull ApplicationKey key) throws IOException, HDIException, ExecutionException {
    final AttemptWithAppId attemptWithAppId = getLastAttemptFromLocalCache(key);
    final HttpEntity entity = getSparkRestEntity(key.getClusterDetails(), String.format("/%s/%s/executors", attemptWithAppId.getAppId(), attemptWithAppId.getAttemptId()));
    Optional<List<Executor>> executors = ObjectConvertUtils.convertEntityToList(entity, Executor.class);
    return executors.orElse(RestUtil.getEmptyList(Executor.class));
}
Also used : Executor(com.microsoft.azure.hdinsight.sdk.rest.spark.executor.Executor) HttpEntity(org.apache.http.HttpEntity) AttemptWithAppId(com.microsoft.azure.hdinsight.sdk.rest.AttemptWithAppId)

Aggregations

AttemptWithAppId (com.microsoft.azure.hdinsight.sdk.rest.AttemptWithAppId)1 Executor (com.microsoft.azure.hdinsight.sdk.rest.spark.executor.Executor)1 HttpEntity (org.apache.http.HttpEntity)1