use of org.apache.hadoop.yarn.server.timelineservice.storage.TimelineWriter in project hadoop by apache.
the class TimelineCollectorManager method createTimelineWriter.
private TimelineWriter createTimelineWriter(final Configuration conf) {
String timelineWriterClassName = conf.get(YarnConfiguration.TIMELINE_SERVICE_WRITER_CLASS, YarnConfiguration.DEFAULT_TIMELINE_SERVICE_WRITER_CLASS);
LOG.info("Using TimelineWriter: " + timelineWriterClassName);
try {
Class<?> timelineWriterClazz = Class.forName(timelineWriterClassName);
if (TimelineWriter.class.isAssignableFrom(timelineWriterClazz)) {
return (TimelineWriter) ReflectionUtils.newInstance(timelineWriterClazz, conf);
} else {
throw new YarnRuntimeException("Class: " + timelineWriterClassName + " not instance of " + TimelineWriter.class.getCanonicalName());
}
} catch (ClassNotFoundException e) {
throw new YarnRuntimeException("Could not instantiate TimelineWriter: " + timelineWriterClassName, e);
}
}
Aggregations