boolean init(Configuration conf, String jobtrackerHostname) {
try {
logDir = conf.get("mapred.fairscheduler.eventlog.location",
new File(System.getProperty("hadoop.log.dir")).getAbsolutePath()
+ File.separator + "fairscheduler");
Path logDirPath = new Path(logDir);
FileSystem fs = logDirPath.getFileSystem(conf);
if (!fs.exists(logDirPath)) {
if (!fs.mkdirs(logDirPath)) {
throw new IOException(
"Mkdirs failed to create " + logDirPath.toString());
}
}
String username = System.getProperty("user.name");
logFile = String.format("%s%shadoop-%s-fairscheduler-%s.log",
logDir, File.separator, username, jobtrackerHostname);
logDisabled = false;
PatternLayout layout = new PatternLayout("%d{ISO8601}\t%m%n");
appender = new DailyRollingFileAppender(layout, logFile, "'.'yyyy-MM-dd");
appender.activateOptions();
LOG.info("Initialized fair scheduler event log, logging to " + logFile);
} catch (IOException e) {
LOG.error(
"Failed to initialize fair scheduler event log. Disabling it.", e);
logDisabled = true;
}
return !(logDisabled);
}
FairSchedulerEventLog.java 文件源码
java
阅读 24
收藏 0
点赞 0
评论 0
项目:mapreduce-fork
作者:
评论列表
文章目录