/** * Creates an in memory job store (<code>{@link RAMJobStore}</code>) * The thread priority is set to Thread.NORM_PRIORITY * * @param maxThreads * The number of threads in the thread pool * @throws SchedulerException * if initialization failed. */ public void createVolatileScheduler(int maxThreads) throws SchedulerException { SimpleThreadPool threadPool = new SimpleThreadPool(maxThreads, Thread.NORM_PRIORITY); JobStore jobStore = new RAMJobStore(); this.createScheduler(threadPool, jobStore); }
/** * Creates an in memory job store (<code>{@link RAMJobStore}</code>) * The thread priority is set to Thread.NORM_PRIORITY * * @param maxThreads * The number of threads in the thread pool * @throws SchedulerException * if initialization failed. */ public void createVolatileScheduler(int maxThreads) throws SchedulerException { SimpleThreadPool threadPool = new SimpleThreadPool(maxThreads, Thread.NORM_PRIORITY); JobStore jobStore = new RAMJobStore(); this.createScheduler(threadPool, jobStore); }
/** * Creates an in memory job store (<code>{@link RAMJobStore}</code>) * The thread priority is set to Thread.NORM_PRIORITY * * @param maxThreads * The number of threads in the thread pool * @throws SchedulerException * if initialization failed. */ public void createVolatileScheduler(int maxThreads) throws SchedulerException { SimpleThreadPool threadPool = new SimpleThreadPool(maxThreads, Thread.NORM_PRIORITY); threadPool.initialize(); JobStore jobStore = new RAMJobStore(); this.createScheduler(threadPool, jobStore); }
/** * Creates an in memory job store (<code>{@link RAMJobStore}</code>) * The thread priority is set to Thread.NORM_PRIORITY * * @param maxThreads * The number of threads in the thread pool * @throws SchedulerException * if initialization failed. */ public void createVolatileScheduler(int maxThreads) throws SchedulerException { SimpleThreadPool threadPool = new SimpleThreadPool(maxThreads, Thread.NORM_PRIORITY); threadPool.initialize(); JobStore jobStore = new RAMJobStore(); this.createScheduler(threadPool, jobStore); }
@Override public void setTenantEngine(IMicroserviceTenantEngine tenantEngine) { super.setTenantEngine(tenantEngine); try { DirectSchedulerFactory.getInstance().createScheduler(tenantEngine.getTenant().getToken(), INSTANCE_ID, new SimpleThreadPool(getNumProcessingThreads(), Thread.NORM_PRIORITY), new RAMJobStore()); } catch (SchedulerException e) { throw new RuntimeException("Unable to create Quartz scheduler for schedule manager.", e); } }
@Override public void setTenant(ITenant tenant) { super.setTenant(tenant); try { DirectSchedulerFactory.getInstance().createScheduler(getTenant().getId(), INSTANCE_ID, new SimpleThreadPool(getNumProcessingThreads(), Thread.NORM_PRIORITY), new RAMJobStore()); } catch (SchedulerException e) { throw new RuntimeException("Unable to create Quartz scheduler for schedule manager.", e); } }
@Override public void start() throws Exception { if (!started) { System.setProperty("org.terracotta.quartz.skipUpdateCheck", "true"); DirectSchedulerFactory factory = DirectSchedulerFactory.getInstance(); SimpleThreadPool threadPool = new SimpleThreadPool(this.numThreads, Thread.NORM_PRIORITY); threadPool.setThreadNamePrefix("scheduling-worker"); threadPool.initialize(); final String schedulerName = DEFAULT_SCHEDULER_NAME + ":" + this.name; factory.createScheduler(schedulerName, DEFAULT_INSTANCE_ID + ":" + this.name, threadPool, new RAMJobStore()); this.scheduler = factory.getScheduler(schedulerName); this.scheduler.getListenerManager().addTriggerListener(new TriggerListener()); this.scheduler.start(); started = true; log.info("Quartz started"); } }
private static void schedulerSetup(boolean enablePersistence) throws SchedulerException { JobStore js; if (enablePersistence) { CConfiguration conf = injector.getInstance(CConfiguration.class); tableUtil = new ScheduleStoreTableUtil(dsFramework, conf); datasetBasedTimeScheduleStore = new DatasetBasedTimeScheduleStore(factory, tableUtil, conf); js = datasetBasedTimeScheduleStore; } 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(); }
ThreadPool threadPool = new SimpleThreadPool(numThreads, Thread.NORM_PRIORITY); threadPool.initialize(); String instanceId = (new SimpleInstanceIdGenerator()).generateInstanceId();