Search in sources :

Example 1 with TimelineReader

use of org.apache.hadoop.yarn.server.timelineservice.storage.TimelineReader in project hadoop by apache.

the class TimelineReaderServer method createTimelineReaderStore.

private TimelineReader createTimelineReaderStore(final Configuration conf) {
    String timelineReaderClassName = conf.get(YarnConfiguration.TIMELINE_SERVICE_READER_CLASS, YarnConfiguration.DEFAULT_TIMELINE_SERVICE_READER_CLASS);
    LOG.info("Using store: " + timelineReaderClassName);
    try {
        Class<?> timelineReaderClazz = Class.forName(timelineReaderClassName);
        if (TimelineReader.class.isAssignableFrom(timelineReaderClazz)) {
            return (TimelineReader) ReflectionUtils.newInstance(timelineReaderClazz, conf);
        } else {
            throw new YarnRuntimeException("Class: " + timelineReaderClassName + " not instance of " + TimelineReader.class.getCanonicalName());
        }
    } catch (ClassNotFoundException e) {
        throw new YarnRuntimeException("Could not instantiate TimelineReader: " + timelineReaderClassName, e);
    }
}
Also used : YarnRuntimeException(org.apache.hadoop.yarn.exceptions.YarnRuntimeException) TimelineReader(org.apache.hadoop.yarn.server.timelineservice.storage.TimelineReader)

Example 2 with TimelineReader

use of org.apache.hadoop.yarn.server.timelineservice.storage.TimelineReader in project hadoop by apache.

the class TimelineReaderServer method serviceInit.

@Override
protected void serviceInit(Configuration conf) throws Exception {
    if (!YarnConfiguration.timelineServiceV2Enabled(conf)) {
        throw new YarnException("timeline service v.2 is not enabled");
    }
    TimelineReader timelineReaderStore = createTimelineReaderStore(conf);
    timelineReaderStore.init(conf);
    addService(timelineReaderStore);
    timelineReaderManager = createTimelineReaderManager(timelineReaderStore);
    addService(timelineReaderManager);
    super.serviceInit(conf);
}
Also used : TimelineReader(org.apache.hadoop.yarn.server.timelineservice.storage.TimelineReader) YarnException(org.apache.hadoop.yarn.exceptions.YarnException)

Aggregations

TimelineReader (org.apache.hadoop.yarn.server.timelineservice.storage.TimelineReader)2 YarnException (org.apache.hadoop.yarn.exceptions.YarnException)1 YarnRuntimeException (org.apache.hadoop.yarn.exceptions.YarnRuntimeException)1