当前位置: 首页>>代码示例>>Java>>正文


Java LogCLIHelpers.setConf方法代码示例

本文整理汇总了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);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:TestLogsCLI.java

示例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);
  }
}
 
开发者ID:spotify,项目名称:spydra,代码行数:17,代码来源:HistoryLogUtils.java


注:本文中的org.apache.hadoop.yarn.logaggregation.LogCLIHelpers.setConf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。