Search in sources :

Example 1 with TimelineWriter

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);
    }
}
Also used : YarnRuntimeException(org.apache.hadoop.yarn.exceptions.YarnRuntimeException) TimelineWriter(org.apache.hadoop.yarn.server.timelineservice.storage.TimelineWriter)

Aggregations

YarnRuntimeException (org.apache.hadoop.yarn.exceptions.YarnRuntimeException)1 TimelineWriter (org.apache.hadoop.yarn.server.timelineservice.storage.TimelineWriter)1