本文整理了Java中com.dremio.provision.yarn.YarnTwillLogHandler
类的一些代码示例,展示了YarnTwillLogHandler
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YarnTwillLogHandler
类的具体详情如下:
包路径:com.dremio.provision.yarn.YarnTwillLogHandler
类名称:YarnTwillLogHandler
[英]Custom Log converter from Twill Log Events to current logger
[中]从Twill日志事件到当前记录器的自定义日志转换器
代码示例来源:origin: dremio/dremio-oss
private Throwable setThrowable(LogThrowable logThrowable) {
if (logThrowable == null) {
return null;
}
Throwable throwable = new Throwable(logThrowable.getMessage());
throwable.setStackTrace(logThrowable.getStackTraces());
throwable.initCause(setThrowable(logThrowable.getCause()));
return throwable;
}
代码示例来源:origin: dremio/dremio-oss
@Test
public void testYarnTwillController() throws Exception {
YarnTwillLogHandler logHandler = new YarnTwillLogHandler();
PrintStream old = System.out;
System.setOut(ps);
logHandler.onLog(logEntry);
代码示例来源:origin: dremio/dremio-oss
@Override
public void onLog(LogEntry logEntry) {
final LoggingEvent loggingEvent = new LoggingEvent();
loggingEvent.setTimeStamp(logEntry.getTimestamp());
loggingEvent.setLoggerName(logEntry.getLoggerName());
loggingEvent.setLevel(Level.valueOf(logEntry.getLogLevel().name()));
loggingEvent.setThreadName(logEntry.getThreadName());
Object [] formatObjects = new Object[] {logEntry.getHost(),
getSimpleClassName(logEntry.getSourceClassName()),
logEntry.getSourceMethodName(),
logEntry.getFileName(),
logEntry.getLineNumber(),logEntry.getMessage()};
loggingEvent.setMessage(MESSAGE_FORMAT.get().format(formatObjects));
// Prints the throwable and stack trace.
LogThrowable logThrowable = logEntry.getThrowable();
if (logThrowable != null) {
loggingEvent.setThrowableProxy(new ThrowableProxy(setThrowable(logThrowable)));
}
if (logger instanceof Logger) {
((Logger) logger).callAppenders(loggingEvent);
} else {
logger.info("Logger is not instance of ch.qos.logback.classic.Logger. Logger event is: {}", loggingEvent);
}
}
代码示例来源:origin: dremio/dremio-oss
YarnConfiguration.DEFAULT_YARN_APPLICATION_CLASSPATH);
final TwillPreparer preparer = twillRunner.prepare(dacDaemonApp)
.addLogHandler(new YarnTwillLogHandler())
.withApplicationClassPaths(yarnClasspath)
.withBundlerClassAcceptor(new HadoopClassExcluder())
内容来源于网络,如有侵权,请联系作者删除!