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);
}
}
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);
}
Aggregations