List of usage examples for org.apache.hadoop.yarn.client.cli LogsCLI run
@Override public int run(String[] args) throws Exception
From source file:io.hops.tensorflow.TestUtils.java
License:Apache License
public static boolean dumpAllAggregatedContainersLogs(MiniYARNCluster yarnCluster, ApplicationId appId) throws Exception { LogsCLI logDumper = new LogsCLI(); logDumper.setConf(yarnCluster.getConfig()); int resultCode = logDumper.run(new String[] { "-applicationId", appId.toString() }); return resultCode == 0; }
From source file:nl.tudelft.graphalytics.giraph.reporting.logging.GraphalyticLogger.java
License:Apache License
public static void collectYarnLog(String applicationId, String yarnlogPath) { try {//from w ww . j a v a 2 s. c o m PrintStream console = System.out; File file = new File(yarnlogPath); FileOutputStream fos = new FileOutputStream(file); PrintStream ps = new PrintStream(fos); System.setOut(ps); waitInterval(20); LogsCLI logDumper = new LogsCLI(); logDumper.setConf(new YarnConfiguration()); String[] args = { "-applicationId", applicationId }; logDumper.run(args); System.setOut(console); } catch (Exception e) { e.printStackTrace(); } }