use of org.quartz.spi.JobStore in project cdap by caskdata.
the class DatasetBasedTimeScheduleStoreTest method schedulerSetup.
private static void schedulerSetup(boolean enablePersistence) throws SchedulerException {
JobStore js;
if (enablePersistence) {
CConfiguration conf = injector.getInstance(CConfiguration.class);
js = new DatasetBasedTimeScheduleStore(factory, new ScheduleStoreTableUtil(dsFramework, conf), conf);
} else {
js = new RAMJobStore();
}
SimpleThreadPool threadPool = new SimpleThreadPool(10, Thread.NORM_PRIORITY);
threadPool.initialize();
DirectSchedulerFactory.getInstance().createScheduler(DUMMY_SCHEDULER_NAME, "1", threadPool, js);
scheduler = DirectSchedulerFactory.getInstance().getScheduler(DUMMY_SCHEDULER_NAME);
scheduler.start();
}
Aggregations