本文整理汇总了Java中org.apache.hadoop.yarn.logaggregation.LogCLIHelpers.setConf方法的典型用法代码示例。如果您正苦于以下问题:Java LogCLIHelpers.setConf方法的具体用法?Java LogCLIHelpers.setConf怎么用?Java LogCLIHelpers.setConf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.yarn.logaggregation.LogCLIHelpers
的用法示例。
在下文中一共展示了LogCLIHelpers.setConf方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testFailResultCodes
import org.apache.hadoop.yarn.logaggregation.LogCLIHelpers; //导入方法依赖的package包/类
@Test(timeout = 5000l)
public void testFailResultCodes() throws Exception {
Configuration conf = new YarnConfiguration();
conf.setClass("fs.file.impl", LocalFileSystem.class, FileSystem.class);
LogCLIHelpers cliHelper = new LogCLIHelpers();
cliHelper.setConf(conf);
YarnClient mockYarnClient = createMockYarnClient(YarnApplicationState.FINISHED);
LogsCLI dumper = new LogsCLIForTest(mockYarnClient);
dumper.setConf(conf);
// verify dumping a non-existent application's logs returns a failure code
int exitCode = dumper.run( new String[] {
"-applicationId", "application_0_0" } );
assertTrue("Should return an error code", exitCode != 0);
// verify dumping a non-existent container log is a failure code
exitCode = cliHelper.dumpAContainersLogs("application_0_0", "container_0_0",
"nonexistentnode:1234", "nobody");
assertTrue("Should return an error code", exitCode != 0);
}
示例2: dumpFullLogs
import org.apache.hadoop.yarn.logaggregation.LogCLIHelpers; //导入方法依赖的package包/类
/**
* Dumps the full job logs for a particular application to stdout
*
* @param applicationId application to dump logs for
*/
public static void dumpFullLogs(Configuration cfg, ApplicationId applicationId) {
LogCLIHelpers logCLIHelpers = new LogCLIHelpers();
// TODO: Add the proper base dir settings etc...
logCLIHelpers.setConf(cfg);
try {
logCLIHelpers.dumpAllContainersLogs(applicationId, cfg.get(SPYDRA_HISTORY_USERNAME_PROPERTY), System.out);
} catch (IOException e) {
logger.error("Failed dumping log files for application " + applicationId.toString(), e);
}
}