use of com.microsoft.azure.hdinsight.spark.jobs.livy.LivyBatchesInformation in project azure-tools-for-java by Microsoft.
the class JobUtils method getJobInformation.
public static String getJobInformation(@NotNull String allBatchesInformation, @NotNull String applicationId) {
final Gson gson = new GsonBuilder().enableComplexMapKeySerialization().create();
final Type subscriptionsType = new TypeToken<LivyBatchesInformation>() {
}.getType();
final LivyBatchesInformation information = gson.fromJson(allBatchesInformation, subscriptionsType);
final LivySession session = information.getSession(applicationId);
String result = "Cannot get the Livy Log";
if (session != null) {
final String livyLog = session.getFormatLog();
result = StringHelper.isNullOrWhiteSpace(livyLog) ? "No Livy Log" : livyLog;
}
return result;
}
Aggregations