Example usage for org.apache.hadoop.yarn.client.cli LogsCLI setConf

List of usage examples for org.apache.hadoop.yarn.client.cli LogsCLI setConf

Introduction

In this page you can find the example usage for org.apache.hadoop.yarn.client.cli LogsCLI setConf.

Prototype

@Override
    public void setConf(Configuration conf) 

Source Link

Usage

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 {/* www. ja va 2s . com*/

        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();
    }
}