} catch (YarnException e1) { log.error("Exception happened when fetching node report from the YARN cluster: " + e1.toString()); throw e1; } catch (IOException e1) {
} catch (YarnException e1) { log.error("Exception happened when fetching node report from the YARN cluster: " + e1.toString()); throw e1; } catch (IOException e1) {
/** * Implement the lookup action. * @param args Action arguments * @return 0 if the entry was found * @throws IOException * @throws YarnException * @throws UnknownApplicationInstanceException if a specific instance * was named but it was not found */ @VisibleForTesting public int actionLookup(ActionLookupArgs args) throws IOException, YarnException { verifyBindingsDefined(); try { ApplicationId id = ConverterUtils.toApplicationId(args.id); ApplicationReport report = yarnClient.getApplicationReport(id); SerializedApplicationReport sar = new SerializedApplicationReport(report); ApplicationReportSerDeser serDeser = new ApplicationReportSerDeser(); if (args.outputFile != null) { serDeser.save(sar, args.outputFile); } else { println(serDeser.toJson(sar)); } } catch (IllegalArgumentException e) { throw new BadCommandArgumentsException(e, "%s : %s", args, e); } catch (ApplicationAttemptNotFoundException | ApplicationNotFoundException notFound) { throw new NotFoundException(notFound, notFound.toString()); } return EXIT_SUCCESS; }
/** * Implement the lookup action. * @param args Action arguments * @return 0 if the entry was found * @throws IOException * @throws YarnException * @throws UnknownApplicationInstanceException if a specific instance * was named but it was not found */ @VisibleForTesting public int actionLookup(ActionLookupArgs args) throws IOException, YarnException { verifyBindingsDefined(); try { ApplicationId id = ConverterUtils.toApplicationId(args.id); ApplicationReport report = yarnClient.getApplicationReport(id); SerializedApplicationReport sar = new SerializedApplicationReport(report); ApplicationReportSerDeser serDeser = new ApplicationReportSerDeser(); if (args.outputFile != null) { serDeser.save(sar, args.outputFile); } else { println(serDeser.toJson(sar)); } } catch (IllegalArgumentException e) { throw new BadCommandArgumentsException(e, "%s : %s", args, e); } catch (ApplicationAttemptNotFoundException | ApplicationNotFoundException notFound) { throw new NotFoundException(notFound, notFound.toString()); } return EXIT_SUCCESS; }