【原創】大數據基礎之Quartz(1)簡介、源代碼解析

一簡介

 

官網

http://www.quartz-scheduler.org/html

What is the Quartz Job Scheduling Library?app

Quartz is a richly featured, open source job scheduling library that can be integrated within virtually any Java application - from the smallest stand-alone application to the largest e-commerce system. Quartz can be used to create simple or complex schedules for executing tens, hundreds, or even tens-of-thousands of jobs; jobs whose tasks are defined as standard Java components that may execute virtually anything you may program them to do. The Quartz Scheduler includes many enterprise-class features, such as support for JTA transactions and clustering.分佈式

二 代碼解析

開啓分佈式

org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTXui

org.quartz.jobStore.isClustered=truecomponent

啓動過程

QuartzScheduler.starthtm

         QuartzSchedulerResources.getJobStoreblog

                  StdSchedulerFactory.instantiate (org.quartz.jobStore.class)get

                          JobStoreSupport.setLockHandler (org.quartz.jobStore.lockHandler.class)it

                          JobStoreSupport.initializeio

                                   setLockHandler (StdRowLockSemaphore)

         JobStoreSupport.schedulerStarted

                  ClusterManager.initialize

                          run

                                   manage

                                            doCheckin

                                                     clusterCheckIn

                                                     Semaphore.obtainLock

                                                             StdRowLockSemaphore.executeSQL (select for update and insert)

                                                     clusterRecover

                          signalSchedulingChangeImmediately

                                   SchedulerSignaler.signalSchedulingChange

                                            QuartzSchedulerThread.signalSchedulingChange

 

QuartzSchedulerThread.run

         JobStore.acquireNextTriggers

         JobStore.triggersFired

相關文章
相關標籤/搜索