Search in sources :

Example 1 with JobStore

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();
}
Also used : JobStore(org.quartz.spi.JobStore) RAMJobStore(org.quartz.simpl.RAMJobStore) RAMJobStore(org.quartz.simpl.RAMJobStore) CConfiguration(co.cask.cdap.common.conf.CConfiguration) SimpleThreadPool(org.quartz.simpl.SimpleThreadPool)

Aggregations

CConfiguration (co.cask.cdap.common.conf.CConfiguration)1 RAMJobStore (org.quartz.simpl.RAMJobStore)1 SimpleThreadPool (org.quartz.simpl.SimpleThreadPool)1 JobStore (org.quartz.spi.JobStore)1