Αξιολόγηση Επιδόσεων Χρονοδροµολογητών σε Συστοιχίες Υπολογιστών

transportdingdongSoftware and s/w Development

Jul 14, 2012 (4 years and 5 months ago)

294 views



ΕΘΝΙΚΟ ΚΑΙ ΚΑΠΟΔΙΣΤΡΙΑΚΟ ΠΑΝΕΠΙΣΤΗΜΙΟ ΑΘΗΝ￿Ν
ΣΧΟΛΗ ΘΕΤΙΚ￿Ν ΕΠΙΣΤΗΜ￿Ν
ΤΜΗΜΑ ΠΛΗΡΟΦΟΡΙΚΗΣ ΚΑΙ ΤΗΛΕΠΙΚΟΙΝ￿ΝΙ￿Ν

ΠΤΥΧΙΑΚΗ ΕΡΓΑΣΙΑ
Αξιολόγηση Επιδόσεων Χρονοδροµολογητών
σε Συστοιχίες Υπολογιστών

Παναγιώτα Α. Βυργιώτη
Νικόλαος Ε. Κοτζαλάς


Επιβλέποντες: Ευστάθιος Χατζηευθυµιάδης, 
  
Βασίλειος Τσέτσος, ι ι  

ΑΘΗΝΑ
ΟΚΤ￿ΒΡΙΟΣ 2007




ΠΤΥΧΙΑΚΗ ΕΡΓΑΣΙΑ

ι  ι ! "  #ι$  ι"

Παναγιώτα Α. Βυργιώτη
.%.: 1115200000014
Νικόλαος Ε. Κοτζαλάς
.%.: 1115200100190

ΕΠΙΒΛΕΠΟΝΤΕΣ:
Ευστάθιος Χατζηευθυµιάδης, 
  
Βασίλειος Τσέτσος, ι ι  





ΠΕΡΙΛΗΨΗ
& $ 
!!
ι! 
ι !ι

ι


   ι
ι"  '
(
 ιι" . 
ι !ι
'ι
! 
$ ' $    !
   ι. ) 
(
!' ι'
ι (
ι*"

 
'ι
. &ι (ι $ 
!!
ι!(  '
ι,    ι 

ι  !ι , 
'$ !ι
 "

 
 
'ι $ 
!!
ι! ι
ι". +, ι '


!


ιι ι

ιι
,  
 
ι 

 ι 
, !
'  $"
 $ 
!!
ι!(   '
 ι
 
 ( !
ι  ι ι 
. #
   


ι,
ι  (ι
$ 
!!
ι!( 
ι"  

! !' ι*, ! ι
$

 ιι    
 
ι  

 

 ι ι !



ι ι' $   
"

. # ι!'
, 
ι !ι



   ι $
 
ι
$ιι 
ι    !
$ 
!!
ι!( 
ι". ) 

 ι  ι 
 (ι
$ 
!!
ι!(  "
ι ! !ι

  ι  
ι !ι

 ιι !' 
*
,
ι   
ιι  
ι  ι

ι ι
ι

ι  .

-%./ ) 0/& ): $ 
!!
ι! 
ι"
12/# 1//: $ 
!!
ι! 
ι", 

,  !
 ,
ι$
, ι!





ABSTRACT
Scheduling can be defined as the process of assigning tasks to a set of resources.
Scheduling is a dominant term in many fields in the area of computing, such as
operating systems, computer networks and enterprise platforms. The scheduling
solutions that are offered, both commercial and scientific, provide a wide variety of
possibilities. However, the ever increasing demands for reliability, high performance and
productivity are making the scheduling area a promising one for developing solutions
with more complex functionality. In this thesis, two scheduling solutions are presented.
Both systems seem to meet the requirements even of the most demanding applications,
since they are capable of working in distributed environments and exhibit high
performance and independence from the operating system. In particular, the first part
presents the architecture of both frameworks, whereas at the second part a comparison
between these scheduling solutions is attempted by testing them under realistic and
more stressful artificial scenarios.



SUBJECT AREA: job scheduling
KEY WORDS: job scheduling, task, throughput, cluster, scalability

ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


5

ΠΕΡΙΕΧΟΜΕΝΑ
ΠΡΟΛΟΓΟΣ....................................................................................................................7
ΚΕΦΑΛΑΙΟ 1 - ΕΙΣΑΓ￿ΓΗ.............................................................................................8
1.1 5ι.....................................................................................................................8
1.2 /ι 
!................................................................................................9
1.2.1 Cron – & " job scheduler [33,34]..........................................................9
1.2.2 Anacron [24]..................................................................................................11
1.2.3 Fcron [34]......................................................................................................11
1.3 #$ι !

..............................................................................................12
1.3.1 JcronTab [26]................................................................................................12
1.3.2 Pulsar [35].....................................................................................................12
1.3.3 Kronova E-Scheduler [4]...............................................................................13
1.3.4 Flux Scheduler [10].......................................................................................15
ΚΕΦΑΛΑΙΟ 2 - POLOS ENTERPRISE SCHEDULER.................................................16
2.1 3
ι' $'.....................................................................................................16
2.2 $ιι.......................................................................................................18
2.3  ..............................................................................................................22
2.3.1 ) *
ι ι 
  Scheduling ! $
..................................................22
2.3.2 Web-Tier & Session Facade............................................................................27
2.3.3 Load Balancing................................................................................................29
2.3.4 Fault - Tolerance……………………………………………………………………29
ΚΕΦΑΛΑΙΟ 3 - QUARTZ SCHEDULER.......................................................................32
3.1 3
ι' $'.....................................................................................................32
3.2 $ιι.......................................................................................................37
3.3  !'
$

 ιι.................................................................................43
ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


6
3.3.1Quartz Cron Trigger…………………………………………………….................43
3.3.2 . Quartz framework  clustered ι*...............................................45
ΚΕΦΑΛΑΙΟ 4 - ΠΕΙΡΑΜΑΤΙΚΗ ΑΞΙΟΛΟΓΗΣΗ............................................................49
4.1 ιι

ι %ι' ι  .....................................................................49
4.2 #ι
ι  ...........................................................................................50
ΚΕΦΑΛΑΙΟ 5 - ΣΤΑΤΙΣΤΙΚΗ ΑΝΑΛΥΣΗ ΑΠΟΤΕΛΕΣΜΑΤ￿Ν ΑΞΙΟΛΟΓΗΣΗΣ..........55
5.1  ι Polos Enterprise Scheduler................................................55
5.2  ι Quartz Enterprise Scheduler..............................................62
5.3 #( ι ι Polos Enterprise Scheduler 
ι Quartz Enterprise
Scheduler..................................................................................................................67
ΚΕΦΑΛΑΙΟ 6 - ΕΠΙΛΟΓΟΣ...........................................................................................72
ΠΑΡΑΡΤΗΜΑ Α΄ – Configurations για Polos Enterprise Scheduler.......................73
ΠΑΡΑΡΤΗΜΑ Β΄ - Configurations για Quartz Enterprise Scheduler.......................75
ΟΡΟΛΟΓΙΑ...................................................................................................................84
ΣΥΝΤΜΗΣΕΙΣ – ΑΡΤΙΚΟΛΕΞΑ....................................................................................85
ΑΝΑΦΟΡΕΣ..................................................................................................................86


ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


7
0&1&5&#
) 
(



!
ι  

ι
   $ι
 


 
ι   !!
 $ι
" #"  .!!
  ι

ι . ιιι"  
ι !  ",    *  
 

,  !ι  ι.
-
'
! 
$
ι! !  ι ι
 .' 3
ι ι

  (ι! * ι
, ι ($ 

 ι  
ι  $  ι'  
"

ι  ι*'

 
,  !ι  ι, ι
  
  

ι   ι! ι 

!
 
   ιι
     



.

.
&"*ι 2007


ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


8
61/& 1
/#5+5)
1.1 Γενικά
# ι' 
!!',  $ 
!!
ι! ! 

$ι  

 :
• Low Level Scheduling
• Application Level – Enterprise Scheduling.
) " 
 
ι
!*ι $ι' 
ι !

scheduling  multitasking
ι ι !


ι ι$
ι(.  
!

'ι 

ι
*ι  

ι 
 , $ι' $ 
!!
ι!(
*
ι!'   
ι 
    

. #
  , ( 
 

ι
!*ι $ 
!!
ι', $ι' '  ι
ι
ι"  

!
ι $   ι
!ι 
ι!' $ι ι !,
ιι  ! . .'ιι $ 
!!
ι' ! 

ι ( ι ι
 
' !ι
 !
 
ι" (batch jobs)  ι
 
$ $ι 
"!
(time-triggered)  ι". .
(ι
$

 ιι   

ι

ιι

ι   ι!
ι! 
(scalability) " 

ιι (  !'

 enterprise 
! ".
7
 enterprise $ 
!!
ι, 
 !' !ι
 (  enterprise

! , 'ι 
ι
ι
'

ιι. ' ι

ιι !( 

$

 ι(   $ι'   ι ι'. . ι  !
ι $

 ιι

 (  $ 
!!
ι!( 
ι
*ι
'   ι
ι"   


 
ι.

! $
  
'$ι  
*ι
 
ι ι ι $

!!
ι,!
ι

(   
ι!' $ι ι !  $ι !  
!ι 
 
'  , 

ι
!*
ι !'
 ι
ι


ι 
. &ι ι $ ι
'
ι  ι
 $
ι  
!
,  
 ι
 $  !
*
   $ι ι ! '
   
'    

 !'$ι     , 
"  
ι ! 
'$


'!

ι


ι
'
ι. +, ι ι! 
ι $ι
  !
*
   '
 !ι
  
!!
ι!'  

 !'$ι 
ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


9
ι !  
!
ι ι '  , 

 


'ι 

ι
     !ι" milliseconds.
# !' !
, 
$,
ι !  ( 
 
, 
!
ι(! !ι

 ιι !'  ι  enterprise $ 
!!
ι",
'
 'ι !ι


  ι
 
 . &ι
$ 
!!
ι'  


 (! 
ι:
• Polos Enterprise Scheduler
• Quartz Enterprise Scheduler
( !

 (! ’
,
! !
ιι

!  "
$ 
!!
ι' 
ι"  '
 (ι  !  !

, 
"

ι !ι
ι

  ι 
 (ι $ 
!!
ι!(
 ι!ι(,  ι' 
ι !ι'. .
!
 
ι
ι
!* !ι



ι ι 
  
$ιι    !'  !
$ 
!!
ι!(, 
ι  '$ι

  ι 
  ι  
ι
 !ι"
ι   
ι 

   " ι
  

.
.
'!
  
(
 !' 
"
ι  '! 
ι 

ι,
ι 

'!

 ! 
ι  ιι ι
!!


!ι".
1.2 Ιστορική Αναδροµή
1.2.1 Cron – Ο πρώτος job scheduler [33,34]
#
!



UNIX $ 
 (tasks, jobs),  ι

 ι"

$,  


 
(
ι
!


 
 $ι ι
!


$  $  
$ι,
ι 

'!*ι. 5ι

ι !
, 
log
$


 
!!
  ι


 
 $ι ι
!


 !ι (

* !
   ι


!*

 $"

!
 ι $".

ι   $ι! 'ι  
 
(
ι "   ( !

*
ι    
 !
(
ι
" 
!   ,ι  

  
 ι $ '$
 
 !
ι . . ι
ι


ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


10

!'
' ι 
 
 
!!
ι(   
 ι 
" !
ι$!, 
    ι' ι* .
% $ 



  Paul Vixie  !ι(   1987 
$ 
!!
ι Cron.  ι!ι
ι !'    crontab !   
' 
ι"   ι
ι !   !'
, !
,  $.    
( !
' $ι '

$  !,
ι crontab ι

 $ι 


$ι,
ι 
.   
!! 
$
(

ι
 'ι 

$ι!'
! .    ! 
'$ι ι
 !
ι!' $ι!'
! !!
. %
   
ι  ι 
' ι!'. .


ι 
:
1. 1: ι!'
 0 !'$ι 59
2. 8
: ι!'
 0 !'$ι 23
3. )!'
 !
: ι!'
 1 !'$ι 31
4. %
: ι!'
 1 !'$ι 12
5. %'
  *!
: ι!'
 1 !'$ι 7
6.   '

   Cron  "   

ι '
( $ι! 
 '$ι 
ι 

!ι!
 , 

 ι!'    
ι( ιι




ιι. " *
ι !ι' !

ι ι !' ι
*ι
! *   

'$ι ι  
!!
ι!' 
 
ι '
, 
"   '
 ' $ι
 ( !
 crontab
$  !
 ' '  
ι
.  

   '  
ι"  Cron !(ι
(   !
 ι

!  $ι $ι ι !
!
'!
  ! ( ! ι 
. .
  ι  ι
'ι 
 
$ ι!   

! !'
$ιι"

ι '
 !
ι !ι' !
, 
"  Cron  ι   ι  
'$ι  
!
 ' 
ι . A ι
ι     ι ι 
ι

  ιι
 
ι ι '$  
!!
ι 
( ι

,
'  ι
ι 
( ( 
   ι 
' ι 

ι ι 
.
& Cron Scheduler 
ι
 ι ι ι
!' ! $
' $ 
!!
ι!(
   
*
ι
 
ι ' !
'. 5ι
' ! 
! '
 
ι 
 
   

!ι" 

' 
 

.
ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


11
1.2.2 Anacron [24]
7
 $ 
!!
ι  *
    Cron 
ι  Anacron,
 !ι    
ι  Sean Perry. ) *  $' !  Cron ' ι
ι
 ι   ι  ( !

ι $"
ι$ !
'!

! 
$
ι (
 
!!
ι!' 
.
ι
 !  
(ι 
'$ι

*!

 
ι!"ι   $ 
!!
ι!' 
ι". 5ι


ι !
 Anacron ! 
'$ι 
  $ !
   !'

 !
  !ι  *
 * !

' 
! '.   

  
ι ι  ι 
  '$  
!!
ι
(, !

( !  
ι
 
ι ' $! 'ι
   
ι
 ! 
ι*
(ι ' 
! '
 
ι  ι 
( !
.
1.2.3 Fcron [34]
%
'ι  Anacron 
ι 
’ '
  Cron 
ι 
ι  Fcron.  !ι  

ι  Thibault Godouet. %     
 
 

ι !


!


  ι!' $ι ι !

ι!,
ι  * !
  ι
$ι
'    ι
 

 
 '$ι ι ι * !

ι  ( !
ι

ι $ι ι !
 ι (. %
ι' ι
'

 


ι  ι  $  ! 

,ι  
'ι !
 
!!
ι!'


! *    !
   ι ! '
    '

ι.
.  !
ι !ι' !
  

 $ 
!!
ι" ' ι
ι
   ι '  
ι"  ι

,
ι  
ι 
 . 7

!
* !

ι  ι !  ι
$ιι 
!
 ! 

$  !  $ 
!!
ι!   
ι".
.' ι
( ! Unix / Linux 
!  !
  ,ι  
!
ι!  ,  !
ι ι$   ι 
  ( $  ι!ι(.
 

  ι

 !'
!

$ 
!!
ι!( !

  


ι ι ι ( $

ιι.
ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


12

1.3 Σχετικά Συστήµατα
1.3.1 JcronTab [26]
ι
ι ι
'
$ 
!!
ι 
 !
' '  cron.

ι ι !'  Java, $ ι!ι"
     Timer 
ι  ,ι

( $ ι  ι
 
ι" !'  ! (threads). %( 

( ιι (ι 
ι"  java ι 
ιι$(   
' 

, Enterprise Java Beans (EJBs),
 
ι 'ι!
 !!

.
.
crontables, 




!*   ι
 ι
$ι  ι
ι"
' 
ι$ ( 

 

*ι
 
ι 
'  , 
 



ι(!
!'


$
!' 
 ι
  
ι !ι
DataSource ι
 (interface).
"  Jcrontab  ! 

ι ι  ι$
 ι" (computer clustering) 
ι   ,ι

    

   ι
ι"  !'
!ι! 
  
(persistent storage)  ! 
!ι     
 
 enterprise
$ 
!!
ι".
1.3.2 Pulsar [35]
& Pulsar 
ι '
 $ 
!!
ι  ι
!*ι ι
enterprise
ι$
. 
ι ι !' 
ι
  Java $ ι!ι"
    
Timer 
ι ι 
$  Java 2 Enterprise Edition (J2EE). )
$ιι 

ι *
ι!'  '
 $! 

! !' ι*. &ι (ι  ι
ι"
 !( 
( 
ι java ι
 
ι Stateless Session Enterprise
Java Beans (EJBs). &ι ι

' 

$(
ι  $ 
!!
ι
!'  XML
$, 
 
! !' " 
ι'$ι  ι


 
ι
  '  

!'. . ι !ι' !
 
ι ι  !

ι ι  !ι
ι$
 ι". # ι' 
!!', ! 
ι 
ι  ι
ι 

*
ι ιι
 enterprise $ 
!!
ι.

ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


13
1.3.3 Kronova E-Scheduler [4]
& Kronova E-Scheduler,

 !'
   
ι
Indus Consultancy Services
! 

ιι 
ιι  $"  enterprise 
! ", 
"
ι 


 
!'
 ι J2EE container. . !
ι ι$ 
 !
  cron-like 
ι ι
 
 $ι ι
!

,  ι!'


 , ' $ι ι
 ι 
 '$ !  ' . . !ι' !

 
ι ι  ι $ι !' ι
*ι
. O Kronova 
'$ι   *
!
!
ι! 
  
ι !*
 !  ι J2EE   '

! ". & Kronova ι
'ι '
Application Programming Interface (API), !'
  
'$ι !ι
ι
 ιι
 ι
 ι' 
! '.
& Kronova

ι
 !ι

!   '$ι   '
   

! " (application server),
 
ι
 ι ι' ι
,  (
 
  Job Agent. 
'$
ι 
 
!'
   

! " 
'$  ι !ι
(instances),  
'

 




 
ι ι
ι ( ι
ι". )  ι
ι


$ι,
ι
 

$ιι,   $,ι ι 
   ι' 
  
ι

'ι  
!
 '
ι !ι. -

! 
! !ι
" ' ι  

$ιι  Kronova E-Scheduler ι 


ι


!


 




ι:
• Instance: 
ι (  ι
ι ιι'
ι
, 
ι
ι"!


$ ".  , 
ι   !   *
ι ι 

 
ι 
$ 
!!
ι! .
• Rules Engine: '$
ι '
  Job Agent " 
,ι
 

$ι ι
!

(
 )
 $ 
 

!'
  .
Job Agent:  !ι
«
ι» Java 

 
ι  ι   
! $ !
  J2EE Container. # !
ι' 
   Kronova E-Scheduler

( ι
. ι  ι!'
 ,
ι ι 

 (ι:
• Command Tasks
• E-Mail Tasks
ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


14
• EJB Tasks
• RMI Task
• Simple Java Tasks
& Kronova E-Scheduler  $ 
!!
ι ι
'ι 'ι ι
ι(
  
!!
ι!( 
ι":
• Scheduled Jobs
&ι 

' (
ι (!
!  ι!'  
!!
 
'$ι

 . 5ι

ι !
, !ι


! 

ι !
  
!'
,   *!
,  
ι !
  !
(.$   "  ι! !'

!

().
ι ι ι !( 
 (  !( 


"
ι 
ι
   

.
• Manual Jobs
&ι 

'
 
(
ι
  ι!'
$ι ι
!

,
!( 
( ! 
  '$ι     . 5ι


ι !
, !


! 
$ι
 
'$ι

!  


 ι ι( !
.
• Dependency Only Jobs
&ι 

' (
ι ! 
  ι  
 ι 

"
ι   (. %   
  
ι 
ι!'
$ !  
   ι!' $ι ι ! 


(
'$     ι

ι(!  .
• File Triggered Jobs
(   ι 
 (
ι !  

   

  ι

$. % 
ι 
( 
   !ι 
,

 


 
$. ι' ' ! 
*
ι  ι

$. 5ι

ι !
!



!( 

$ 
!!
ι 
'$ι     '

$  ι!'
(  !ι 
ι 
,ι.
ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


15
3
ι !ι' !
 Kronova E-Scheduler 
ι  * !
 
*ι
 

ι,
ι 
" ι ι
  !( 
ιι ι ι ι
 
' .
'
 (,  $ι 
 

   
ι ι
    !'


    

. . ι  !
ι, !, * !


!'ι  ι
 
ι
 Kronova E-Scheduler ι   

! !' ι*  
ι,ι

 


! 
 !

.
1.3.4 Flux Scheduler [10]
ι
ι ι
'
 $ 
!!
ι ι !'  java,  
'
ι 
 

ι"    , 'ι  $  !

$ 
!!
ι  
!!
ι time-driven, event-driven 
ι file-driven
ι
. 5ι

time-driven tasks 
ι !  ι

"  ,
ι 
ι

 $ !!


 
ι ( 
 
!*  
 "ι
! ι. ) ! $
  Flux ι  !
*ι
'  
ι (
ι
ι ι,
ιι   !
ι! '

( $ '

ι" 
ι ! 
  ! ι
 * !'.



ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


16
61/& 2
POLOS ENTERPRISE SCHEDULER
2.1 Βασικές Αρχές
& Polos Enterprise Scheduler

($  

ι
 ι !'  ! *
ι
$  $ι
! !
 '

$ιι (  
 ,
*ι
,

ι! 
 
ι
ιι
, *
ι!'  ι $ι' 
    Java 2.0
Enterprise 
!
 
ι 
ι  !  
   !"! 
!


$ Location Based Services [1], !!ι   

 . .  ι!ι 
ι


 !'  "
 
!!
ι!( Java, ι 
!' $ 
standards  
'$
ι
 o enterprise framework 5.0   "

 
!!
ι!( Java 
ι  J2EE Container  $ ι!ι  
ι  JBoss
application server.
% 
ι ι     ( J2EE application servers
(WebLogic, WebSphere, JBoss). 7$ι $ι
 ι

ι   ι$

  ", !       

  !* !  
 !' '

J2EE    

ι !ι

 ι
ι

, 
"   !*

,
ι

!

 !'   ι$
 
ι  
ι ι
 

ι 
$ 
!!
ι.
3
ι $

 ιι  
$ιι , 
ι
'!  !


  $ *  !',
 
ι ι
 ι ! $
ι!(
!ι! 
   !'$ι   ι!'   

. .   

    
ι",  $ 
!! 
ι  


 
!'


!*ι '
 

! !' ! $
ι!  !!  (cache),
 
!'
 ι'$ι  $,
ι    !*   ι$

  ! !*.  
,
$ιι
, !
'ι   
'  

ι ι '
   
ι 
       ,  
'$ι 
'!
!ι 
ι. ) ι 
 '$ι 

!

:
• ι   !
ι"  !
$
 !  

 
ι 





 
 ι  !*,
ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


17
• ι  
  
(
ι
   ι
ι

( 

ι   * !'.
#    Polos Enterprise Scheduler, o 

! !' cache ! $
ι!
 $ ι!ι  
ι JBossCache [ref]. ) JBossCache ! 
!
 
 ι JMX (Java Management Extensions) !*
    ! 
!  MBean. $ 
ι
$     !
ι$

 ι":
• H ι
  ,  
!'

 (
ι ι    !*
  ι$
 $ 

'$
ι  !'   !* ι’
.
• )
( $ replicated
  , 

 (ι ι 
!'


,
 
ι 'ι
( $
! (!

" 
 !"ι 
 !* ι’
.
• ) ( $ replicated
  , 
,   

' 
!', ι"ι 
!'
   !* ι!' 


 !"ι ( $

ι ! 
 ι '$  !  ι$" ι 
!
.
& Polos Scheduler 
!,ι   ι, 
"  
ι !
"ι

!'. + !ι  ι 
ι ι

ι ι  . #  
 $ ι!ι
ι ( $ replicated
  , !

  
!', '$ι 

'!


  '   !*
 
 ι, !'$ι 

 

    !*, " 
 

ι  
 

ι( *
 
 
!'
!
ι, 
"

ι"ι '  «ι'ι». . ( ι, 
ι ι

! '
 $!   ι, ( ( ! 

 
ι
ι' 
«*"!ι
»  ι !'
.
.', 'ι 


 (!  $ 
JMX (Java Management Extensions),
   
 
ι *
ι!'  scheduling ( !
. %
  
$ 
, '

ι !
 
!  
"
ι
 '
 ι

Managed Beans  MBeans, 

 
ι  '
MBean Server,  
ι  
 ι
$ιιι 
 ι
'
 '
(  ι" ι

$ιι!  MBeans. 7
 ι'   ι
   PolS Scheduler
*
   JMX $ 
, 
ι ι
 
'$ι '
' managed Java Timer 
ι
ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


18
'
' !' !*. ,  Pols Scheduler 
ι !'
 '


$ιι,! ι*, ι!' 
ι 
ιι

ι
ι, 

!( 
$ ι!ι   
ι Timer   Java, 
" 
'ι 

$ ι!ι
ι '  managed ι*
ιι  !ι  !

'
 
' $  container.
2.2 Αρχιτεκτονική
& Polos Enterprise Scheduler  ,ι  
$ιι   '
*
ι
!

, 

ι 
ι

ι 

:
• Management Subsystem

ι  ( !
  ι
!*ι ι !   
ι ( 
ι
  ι
$ι  
ι". &ι
ι 
ι
  'ι !ι

scheduling ! $
 ! ι ι' ι
' $ ". . management
( !


ι
 ( session stateless EJBs,  '

ι
ιι!' !    
, ι

 
ι

 
ι" 
ι   
ι
(  ι
   !'   '$
 

   
ι",  


'ι !   ι'   '$


 .  

session stateless EJBs ι ( 
   ! ι
(   scheduler
!  Remote Method Invocation (RMI) Clients.
• Execution Subsystem


!*ι  
( $ '  ι
ι"  
$ 
!!
ι!'  

. . Execution ( !


ι



!
 Message Driven Beans (MDBs), 



'ι ι
ι 
. ) ! $
 '    !* ι
*,ι ! (!



   ! ! 
ι ι
  '


 
! (!


 '

message-driven bean 
ι   

ι. ) 

  ! (!


ιι$   '   

  ι 
ι
 
!'

! (!
. 5ι
  *   
 , ι
 
ι !

! (pool)
'ι! MDBs, 


ι 'ι!

* 'ι
! (!

. #
 

!  
ι '
!' ι ι $ ι 
. #    ι

, ι
  ι' !!
 !ι 
ι '
' ι !ι !'$ι


 
ι  ι !' ι ι, , 
    , 
ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


19
  !!
'ι 
ι!'ι 
   ι ι !ι " 




 .
• Scheduling Subsystem
   
ι  scheduler 
" 
ι (  ι

 
!!
ι!,     
ι  ' $  
ι". 
ι

 

ι MBeans:
o . ProviderMBean, 
ι
    
ι ι 
 !' !ι

!   
 
ι 
 
ι$ Session EJB " 


$ι



. 
ι   ιι!' !    
   

ι"
   cache. & $ι   ' ι
ι  ι ι 
 $ι
!( «singleton», !
'!



,
ι ι 
ProviderMBean 
ι
$ιι !'    !*   ι$


 
(ι !  '
.
o . ManagerMBean, 
ι
   ' $ι    
 Timer 
ι
ι  ι' ι ι !'  
ι" 
ι  Notification
Listeners. 
ι (  ι
  

$"   $ 
!! 

ι"  Timer 
ι ι
  ι
$ι  " ι  ιι
(notifications)  'ι.
o . TaskMBean,   

ι
  Notification Listeners 
ι $ !
,ι

! (!

, 

 (
ι   .
• Caching Subsystem

ι !

       ι"  $,
ι
! ι  ' 
 
ι   
' .
.
'
!

 ι  
 

, $   
!* (nodes)   ι$
, ! 
 ,  scheduling ( !
 
ι
 ι !' !  '
,   $

 ,
ι 
 master !*.
)    
ι ι 
 scheduling !
 
ι 
!ι, 
"
$ι 
 



 
ι ι 
 !
  ( !ι
$ι ι !
 ι
   !*   ι$
, 
  ι 
 !*  '$ι  scheduling ( !


!
ι

$
. 9
ι !  '$ι
, !'


  
ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


20

ι

! 
ι
 ι 
 

! 
 !

(fail-over).
.
ι

!

ι (    !*   ι$

! 
!ι ι ι 

ι !ι.
. Management ( !
,   ι  
 !' ι
(   $ ,
  
 ι !
ι
 ι

! ' 
", " 
$ι 
 

ι
 ,    
ι !
ι!( !ι
 ι
ι


 ι !*.
. scheduling ( !
ι , 

'
!  !',  '


 !*   ι$
. (ι !' !
 
ι 

!  

ι(! 

ι ι$( ι
  '  
ι". %ι
 ! ! ι 

  ιι
 !  $! ,   !!

 (
ι
   ! 
  
 !ι
 ι
' !ι
 

,   



!'
  

  
ι    ι !
'
ι   !!

.
&ι
ι,    ! (!


  scheduling ( !
 execution
( !
. 
 *
ι  ! ι
  
  (  
enterprise $ 
!!
ι", 
" ι ιι '$ 
( 
ι
 
'  
ι" ι$
, 
$ ι!ι( !  
$ 
!!
ι " 
 ι  ' 
. #
   !,
' ι
ι 
 
     

!   (load-balancing), 

'$
ι 
 
(
   ! $
" '  
ι" ι 
ι 
ι ι
!*ι   ι$
.
) 

 ι
  scheduling 
ι execution  ! '$ι 

' !
ι 
ι 
 $ ι 
. +,
 



,ι    
ιι
 
ι ι
    ι" 
$,
ι ! ι $ 
!!
ι,! ι
ι
 
ι   ' , 
 o '$ι

*ι cache ! $
. ι  ι!'
!'  ( $


! !' cache ! $
ι!(, 
ι $ ι!ι"
  (ι
!! , ι
 (
ι


!'
 $ι,
ι    !*   ι$
. 7ι
ι $
ι   !* 

ι
! '$
 *
  ι

 


 

ι ι
'ι! 
ι 
!  
ι   ι ! !!'

 ι  !*. ι', 
ι 
 
 '
 !* 


*ι
   $ 
!!
ι!    ι ι ι !*ι '$


(ι.     !


 
ι 

! !' cache ! $
  ι 

 
 $ 
!!
ι 
!  $ι,
ι 


   
ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


21
ι 
 

   *    . 5ι
  ιι
!
(
 cache  !

ι
ι ιι  
ι
ιι  

ιι!' 
( 
!'
,       

 ' (ι.
#
  $!

ι,
ι
$ιι  Polos Enterprise Scheduler 

ι$
ι" !*.

#$!
1: $ιι  PoLoS Enterprise Scheduler.
. scheduling ( !
'$ι  !* C, !'

  !*
 , ι ι  $ 
!!
ι,! 
ι". 
ι $
ι !   ι! ! !   . & !*

 
ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


22
Master !*   ι$
. .
execution !

, !  ι ,

*, 
ι
! (!


ι  !ι ( ι
  !!
'
!
ι
 

( $ '   

  ι 
ι
  !!
 '$


*ι
   .
&   $ , ιι !' ι" ι
" ! '
 !*  
ι$
. &
ι$ manager  !*  !"ι  $! , 
 '$ι  Master !* C ι
 ι ' ι  $ . ) cache
 !"
ι $ι ! ι
  ι
 ,   , ι

 !ι
 



  
 
ι ι

'!
  '   .
.',  ( !
Polos Enterprise ι 
!
!'
 '
J2EE Container
   ,. %
ι

  , 
$ι    

! !'
ι*, 
ι   $ι!   ι"  !*   ι$
 
 ι
!*ι '$  $ι ! $
!

. (

 
!  *
ι  !
 

$ιι ,  '$ι

$!  !
ι !
  
ι 
 
ι
$ιι .
2.3 Ανάλυση
2.3.1 Η βασική λειτουργία του Scheduling υποσυστήµατος
)   

 
ι  Polos Enterprise Scheduler ι 
ι
 '


ι! ( ScheduleData,   
ι '
JavaBean
ι! ! 
!
* ' – !' ,  ι !ι   Java  , 
ι  Schedulable
ι
 
ι
   $ 
!!
ι,! 


ι '
 $  ιι"
 ι!' 




ι
  Hashtable Java  . ) Schedulable ι

,ι ι !  execute() 
ι execute(hashtable) 
ι 'ι 
ι
ι

    ι ι !ι


. . Hashtable 
ι '
 

!
ι!'


  ι'$ι 
!'
 $ι,
ι 


ι ι  
 


 

ι 
ι 



$ ι!ι !
(  ι
$ι"  
'.
) !  $ 
!!  '
ι 
ι
( 


" ι
ι ι

(  *
ι
!
  ι 
ι
, 
ι ι


 
ι' ι ι 

 ι 
 
ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


23
$ 
!!
ι!( 
ι ι. .   $ 
!!





ι

'
Java Bean ! 

!':
•  $ '
 ,
•  !   ι,
•     

,
•  (   $ι !ι, 
! 

ι:
o fixedDelay,    
'     ' !ι


  , 
' 
 !

ι 
ι ι !ι'
'ι,
$,
   '  
!' !  
  

ι !      ι.
o fixedRate,    
'  , ι ! 

ι
(
ι (  
!'$ι
 
 ' 
!*
ι

 ! 
$ι $ 
!!


#$!
2: .
Java Beans  ι  Jobs & Triggers.
# $!
3 
ι,
ι
$ιι  scheduling !
 
ι





ι !ι
ι 
   
 
ι '  !
 

, 

ι 
ι

ι 

.
• 
• 
• 
ScheduleData

InvokeData


  
• !
• "
• #$% #



ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


24

&'()* 3: To scheduling ( !
 Polos Scheduler – .ι ι
ι


 
 !
 

.
& Manager 
ι
   !,ι 

, 
" 
  
ι '
 
ιι Providers, ι ι  ( ! 
 
ι
$ !!

.   
, ,
ι ! '
 Provider   
ι '

MBean 
ι ι
'ι ι !  start() 
ι stop(), !'   
,
ι
'
 
ι    ι 
 . ι  !' ι  Provider 
ι
insertSchedule (InvokeData, ScheduleData), 


ι
 '
Session EJB,
" 
 ( 
!'

 

 
ι  $ !!
  


ι loadFromCache(), 


ι
!

     Provider ιι

ι 
 !  ι     insertSchedule ι
  

 $ι   cache.
H insertSchedule ' $ι
  Manager 
ι ι
'ι!, 
ι !
'
ι  Manager
!'   addSchedule (InvokeData, ScheduleData, Boolean) ! . ) 
!
Provider MBean

!+ %




T
i
m
e
r


$
,!-.$

Manager MBean



/ $
/,!-.$

Task MBean

0!!+1!!!

$

,!-.$
,!!

2!0!

+

+!

ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


25
( Boolean 
,ι   
!'

 

 

  $
  *
   cache.
# '$ι
,  Manager 
ι 
InvokeData 
ι ScheduleData 
ι 
  
!
'
!  !,
ι ScheduleInstance. ,   "ι  !  ,
ι
!*ι 

!'
ι
  

,  
  ι'$ι ! ι
$ι'
  $ 
!!
ι!(
 
ι ι$
$ι !   '$



   

,    ι

  *
ι. 9
  !ι 
ι
'
ScheduleInstance 

 
ι '
 auto-generated !
ι
ι ! 

   
 
, !   

 (
ι   cache. # '$ι
,

   
  JMX Timer " 
$
 !ι 
ι 
ι '

Notification Listener  
(ι ! 
Notifications 
ιι$( 
 ι!' ScheduleInstance, !'  
  .
& Notification Listener *
ι  



! '  ιι  " 

ι !


. 9

 ιι
ι,
$ι ' $ι
 

MBeans
*
ι  ι 
 ι '$ι 
!
ι. #   ι (

, ' $ι
 


ι
! '   '$ι
ι
  $ . 

ι
!
'  , 
  TaskMBean,   
ι 

ι    '


,  
 

ι  ScheduleData 
ι    
ιι$  


.    TaskMBean ι'ι ι$",   !"
ι 

ι$ ScheduleInstance, 

ι  ι 

ι
ι 
 
ι

(  !ι"ι 
ι !  
!ι 

 
 '
. .
TaskMBean, !, '$ι
!
'
ιι
 ,   ' ι
ι  ι ι
  !

!ι! ( !    ! !,
ι$(ι $
$
  
ι  !ι
'ι

 
 


 . .
TaskMBeans 
ι !ι!
!'

!   master  
ι
ι$(   

   ι"
 !ι

ExceptionListener ι
. %
 !
'ι

$ , 
( 

  ' master !* 
ι 
 (  '
. ) ι
ι




(  
ι ( $ ,  
 
ι !   
ι  !'
 
 ι
 ι
ι!,    !
  MBean, !
'!



ι,
ι ( !ι  

( 
(
!

ι $, ι


ι !
, 1000 ι  TaskMBean 
 $, !
!



!*
!  ι


(  
!*ι $"
.
ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


26
)  ! !,    
 
ι 
'$
ι ι  ' 


ι 
ι !ι,ι 


! !'
MDBs, 
ι !'  scheduling
!
 
ι !' 
(ι   «singleton»,  
 $ι
!  master !*. # 
$

(, !ι
'
  !ι 
ι
 !*  ι
ι  
 master.
. Scheduling ( !
,  '$!  ι, 
ι ι
ι !

!

MDBs,    
ι 

 
ι
! (!

 *
ι  
 
ι 
( ι
ι$ 
. %'
   ι
ι

,

!
ι
ι 

!   

  
ι   ' 

ι". ) 

!
 

ι
 
 
$

 ιι:
•   *
    ,
•  (  ! !,
• 
 ι ! 

!
" !'
 ι$
  ".
"  !'     
!  MDBs,  !' ι
ι ! MDB ι !ι 
ι

    (  !   , 
,
ι
 

!'  '$ι ι
 ι
$ιι 
ι ι ι
$ι,
ι  EJB Container.
9 '$ι 

 , 
 $ι !
ι$
N !*,  ! !

ι !  '

  !*   ι$
,  Master !*.
!', 'ι ι EJB Containers    !* 
'$  

 

     Master !*
 
ι 
 ( !
,
 . . ι

ι  Master !* 
ι !ι

!ι ι    
ι

ι!' 
    

 ,
, 
ι     Master !*

!
ι 
ι ,  ι


*ι
   
ι, !, !ι
$


ι .
& Pols Scheduler *
,
ι  '
! $
ι!
!
 

   ι

  $ ι!ι $ 


ι
ι 
'!*

  $ ι

ι! . !',
$    ! ! 
!
ι
ι

 $  high availability  global JNDI  . ι
ι ι
'

ι ι!
   !*   ι$
  


$(
ι
ι!

 '
 ι!' !
. . ι



ι  $ι '
 $ι !*   ι$
  ι 
. )  ι
ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


27


,   
  ι 
ι
 :
1.   , (! !
$ι  cluster-wide '  ι'
ι.
2.   , (! !
 $ι  cluster-wide ', 

, 


 
ι  ι Java Naming Directory InterfaceJNDI  !*
 
 '$ι
$ι 
ι
 *   ι'
ι.
3.   $ι (  ι JNDI  !*
   '$ι
$ι,
global JNDI  
ι   '

  !*   ι$
  
ι  ι ι
'ι '
'ι !

ι ι'ι  "
ι$

,  ,  $ι 'ι
.
4.  
'
ι ι  ι
'ι  , (! !
,  

ι
'
NameNotFoundException.
!',  ! !
ιι$  '
!
ι !
 ι ι
 Master !*. #(!
!  


 ι !

,  ,  EJB
Container  Master !* ,ι     2

*!

  ! 
ι ι
EJB Container  N-1  !*  3

*!
. 9
  Master !*

!
ι 
ι , ι EJB Container  N-1  !* ι( !ι

ιι  ι
' ι!(, 
ι  ι, 
( 



 ( !
. )  ι
ι


 

.
& (
"  ! ! 
ι  ObjectMessage  ,
ι  JMS API 
ι
  !!
ι '
serializable
ι!. 5ι’
    $ι

 
 ScheduleData,  
 
ι!  !
'
ι    !!


ι
serializable,

  
ι$(ι 
ι ι
  Schedulable ι

 
ι ι

( !'  ι'$
ι  Hashtable.
2.3.2 Web-Tier & Session Facade
. Management ( !


ι
 ( Stateless Session EJBs, 

JobRegisterBean 
ι JobMonitorBean. ) ι ι 
 $,
ι !  
  ,

 
ι ι   
ι" 
ι
$ 
!!
 
ι    !'   '$
 

  

ι",
ιι"
 
tracking data.
ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


28
& client   $ ι!ι
ι  Polos framework 
ι '
 web client, 

'$ι web , "
  $ 
!!
ι ! ι 
 


!' !' GET 
ι POST HTTP . %ι
'ι
    
 
 !
 '
 

 !
, !  $ 
!!
 . ) 

ι
!*ι  $ι' 

!' ' ,  !
      
ι,
 
ι ι ι' 

!' ι  (
ι  !'

  

.


&'()*3456*7689:;<)*8η>7*?*7@AB "C:(<η>D<86 !;7E7;F6
)  MyDumpJob, 

ι $ 
!!
ι,! 

, 'ι 


ι ι
'ι!  ClassLoader   JVM  scheduler.  ! 
ι
 "
   ι       
ι$  

'$
 
$  .
#   !*   ι$
 
ι ι
'ι!  web tier   ιι ! 
Session Tier !'  ι" ι
"  EJBs. !', !'  web-
interface, '
 $  ! 
  !  browser   ι  

 ι !*   ι$
.

G 

 "

!


%$ HI


%J






%K



InvokeData


  L %  
• !LMNN
• "LONNNN 
• #L
ScheduleData

InvokeData

ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


29
2.3.3 Load Balancing
) 

!   (load balancing)  Polos Enterprise Scheduler *
,
ι
  

! !' ι 
 scheduling !
. $ (

 ι !ι  $ ι!ι(
ι ι
  

!   

:
• High Load, ! * 
 ι !
 
! (!


$ι 


ι 
execution ( !
 !*   *
ι , 
ι ! 


! !ι, ι ι !*ι ι( 



" ! (!



  .
• Competing Servers, 
 ι !
  ,
ι   round-robin  ι, !
*   

! (!

ι

'!
ι !
(  !*  
ι$
. !', !   ι
, ι ι !*ι   ι$

(
ι ιιι

ι'   

 ! !.
2.3.4 Fault-Tolerance
) 
 
 scheduling !
 
 ι
ι
!


ι !* !ι
 ι$
 

,ι  

!
 !ι

$

(fail-over) 
ι  
$ 
!

'  (fault- tolerance).  ι$(ι  
  o Master !*  
ι  ι 
, ι
ι    
 
   
$ι !
 '
ιι
 !*, 


 
!
ι 



"ι ! (!


ι !' 
 
. &ι

  ,
 ι

  !*,
(
  ι
!*   ι$
.
.   ι ι 
 
ι 
$ !!
  
ι   cache
 
ι ι 
$
 ι
 
!!
ι,! '  
  
!
ι!(  !*.
9
  $ι
! 

,ι  ι
 ι
ι! 

$ 
!!
ι   $
 
ι   ι
ι  
ι" 
ι
 $ 
!! " 
!   ,
ι
 $ !


!*,  
ι  Master  $ι.
ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


30
. ( !

 ,ι
!

ι ι
ι 
   (
ι  !*

 $ι
 
ι ι
  *
ι    ! !  
   !* 
 $ι 
ι  %aster.
9
 ι 
   "  
 
 ι
ι


 
ι 
ι

 (  . .
MDBs, 
ιι, !( 
 !" 

ScheduleInstance   cache $ι ! 
 '  ι$" 

 $ι.
+,
!

ι
 
'$
ι  !' ι

 '  

 $ι, 
$ι    ι

$

 ιι,   
 ιι
 
' , !
'!

!  ,!  'ι 
*!   $ι
 !' .  
ι     
$ '$ι 
ι ιι


!

ι
 $ι '

"
 $ι 
ι !'
  'ι 
'$ι
  ,
(! ι$
 !'$ι ι  ! $ ι ' 

' ι  !
ι!. #
    ι 
ι !ι

: ( , (!
!
  
,
ι '
$ι ι "ι  !      

 !'

 'ι 
$ι  !'  

'$ι . #  

   
 (   $ι !ι '$ι ι 
 fixedDelay 
ι
! ,
"ι
ι**
     
' .
9
 ι 
  *
ι !  ! ! ! !'
   
Master !* 


 $ι,  $!  
'$ι !
ι'
 !'   cache. 7ι, 
MDBs !(   
ιι 
 !ι(
"    


!* !


, 
ι$ ScheduleInstance  
cache 
 !"
ι. . Provider MBean 
ι
 


!*ι 


 !'   cache, !'   
 ι $
ι
$ 

!


ι   ιι   ι
ι



!  ι
(  :
• ιι
ι
    , ι ' ι


  ι$

 
"ι
  $
 !*
•  ι
ι
!

 
"ι
  %aster !*.
. Provider MBean, 
  ι
ι

 

! ,

 


ScheduleInstance  
ι  cache, 


ι  Manager !    
,  
'


 
ι !ι

ιι  recovery mode. ) ι
ι


  
 ( 

ιι
, 
"
$
 $
 !*  ,ι  
ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


31

*ι
! !ι( !'  (! 
ι" 
ι 
!


 
*
  ' .

ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


32
ΚΕΦΑΛΑΙΟ 3
QUARTZ SCHEDULER
3.1 Βασικές Αρχές
9 ι
ι"
!
  

 !
 ι ι (ι
$ 
!!
ι!(, !ι' 
ι ! , $
 $ 
!!
ι'
ι !'ι  java, ι ι 
ι, enterprise $

 ιι. # 

(
$ι ι !, 
$  $"  ( $ 
!!
ι!(

ι  Quartz. & Quartz 
ι '
( !
$ 
!!
ι!( 

ι    ι  2001
  James House. ) 
$ 
ι($  !
   '
    ι 'ι
 Open Symphony  ι!ι".
%'

 
$ι
,
  2001 !'$ι !
, '$ 
ι
 ι
ι  ! ι ( $   1.6, 
$ ι!ι  

ι

  
!' .
& Quartz 
ι 
!!'
ιι  Java, $ι
!' 
! 


ιι    J2SE  
ι  J2EE 
! '. 'ι ! 

   $ι
! $ι

!! '  ι
ι", ι"


 ι ι
',    
!!
ι!   '  !
 

   !'

 
 "
, 
ι 

 
 ι ι ,  !ι




'ι 
   



   !

  ' 2002 !'$ι 
2005. # ι' 
!!', ι 
 
ι  
!!
ι!' 
' 
 '

trigger 
!
ι
ι. .
triggers !( 
 !ι ( ! $
ι 
!  

:
• #  ι!' $ι ι ! !'
  !'
.
• #  ι!' !'   *!
.
• #  ι!' !'  !
.
• #  ι!' !'  

 
!!' ! .
• 4



!*
ι  ι!'
ι ! ".
• 4



!*
ι !'$ι ι
 ι!' $ι ι !  !! 
.
• 4



!*
ι
ι
,
 ιι ι
!

.
ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


33
 $ι ι ιι!   
!   Quartz 
"
'
ι  ι
  
 :
• % 
!
  !'
 ι
  
! .
• % 
!
  !'
 ι
 
!  
'$ι !'

 '
    
! " 
ι 
ι !'  

' ! ι

$ι
 * .
• % 
 

  
!  ($ ι!ι"
 ι 
JVM) 
ι 

 !'  RMI (Remote Method Invocation).
• % 
'$ι 
 ι$
(cluster)
  
! "
'


!
 !


ι 

! , 'ι ι



 (! 

.
ι'$ι  300 Java ι 
ι ι
' 
ι 
ι 
!'  12 
'
.

   !'    "ι
 ! 

'ι $

 ιι
!'     ι 
  $ 
!!
ι, , 
ι !ι

 'ι
  ι ι 
  '
ι.
) 
ι  Quartz framework 
ι  Scheduler. & Scheduler 
ι (  ι
 

$ι  ι* '  (runtime environment)   Quartz 
! .
 ι    

! 
 *
,
ι   !
ι 
!!


!
. & Quartz *
,
ι ( 
!


ι   ι
$ι . ι!'

   ι! (scalability),  Quartz *
,
ι   !
ι
$ιι
(multithreading).
   '
 ,  framework
$ιι !ι
!

 !


  (worker threads), 

$ ι!ι(
ι
  $ 
!!
ι ι

  '  
ι". %
  , ι $
ι 
  '
" 
ι".
%


   
 Quartz, 
ι
 !
Java    !ι

ι

,   ! 

ι ι ! 
 
!!
ι  java
"ι
. ) !

  
ι ι
'ι 
 
ι  
org.quartz.job ι
, 
ι'$ι !ι

ι ! !' ,   execute(), 
ι 


 '
JobExecutionException   *
( !
.
9
  Quartz 
  !'  execute(),   ι 
 ι!

org.quartz.JobExecutionContext,   ι
!*ι  "
 ι" ι

ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


34
ι* '  !'
  
ι 

. . JobExecutionContext
'ι *
  ι$
$ι !  $ 
!!
ι,   

, 
trigger 
ι 
!
. #ι ι ι"ι,  JobExecutionContext
$ ι!ι
ι ι

$ι *
   org.quartz.JobDetails  . )
JobDetails 
 ! ι$
ι
  

, !ι
!*
!'   
!

 
ιι!'   

,   !
   

ι 
ι '
 ι
'  . ) JobDetails, !  ι  , $ ι!ι 



   org.quartz.JobDataMap. ) JobDataMap ι'$ι ι$
ι
 $
  ι 
ι 

$ !' .
&ι ι' 
ι 
triggers $ 
!!
,
ι !'   Quartz Scheduler
ι
. 5ι

! '
ι !ι  $ 
!!
ι 'ι 

 !ι !
  factory.  

  (  $ 
!!
ι
 $ ι!ι
ι,  'ι  
!
 
 !ι 
ι !ι



 
,
 ! !' !ι
 !   factory 'ι " 

ι*  ι


ι$
 '$
$ιι  . 
ι*"  
org.quartz.SchedulerFactory ι
.
& ι (  ι


!
ι  ι 'ι 
ι    ! 
getDefaultScheduler()     StdSchedulerFactory. 9
 $ ι!ι
ι 
( !
 Quartz, 
ι


  
ιι  $ 
!!
ι !'  
!  start(). ) ι  ι!'
 
 ι" ι!' 

$ ι!ι   Quartz  !ι

!  
ι:
• )  !ι 
  

.
• )  !ι 

ι
 ι!" 
triggers.
• & $ 
!!
ι!  
ι" 
ι  triggers  '$ 
 $ 
!!
ι.
• )    $ 
!!
ι.


!
 ι
'

 
 
'$
ι
  ( !

Quartz 
ι  $ 
!!
ι! !ι
 

 !  * ι
 XML
$.
.
$ ι'$ι   $ι' !  


ι 
triggers, 
ι ι
*,
ι

       
! . . ' !

   
 
 
ι

    
" ι


  
ι


 
ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


35
XML
$ 
ι     
!  
ι $ι

'  "ι
, !
"ι 
ι
 

  ' "ι
.   '
ιι 
ι !
 'ι XML

$:


&'()*J4P
0*?';E6QR*86'?6A67?6Q?*))*8R<)S)R*>;?Q*<E*>I
. ( !
 Quartz ι
'ι  ιι

$

 ιι !
(  
ιι
 ' '$ ι Quartz Listeners. &ι Quartz Listeners 
ι ι Java, 
 !ι (
ι
  $ 
ι !( 
 (
  ( !
 Quartz.


ι !
, 
 !ι


'$ι $ 
!!
ι  
 '
trigger '$ι
  , 

 
 
!( 

ι( " 

 !" '
Listener. . ( !

'ι Listeners ι

$ 
!!
ι, ι
ι ι'
 
ι ι

triggers, 
ι 
ι  ι",
global  $ι ! ! !ι
 ι!' 

 ! '
 ι!' trigger.

<?xml version='1.0' encoding='utf-8'?>
<quartz>
<job>
<job-detail>
<name>testJob</name>
<group>DEFAULT</group>
<description>
A job that scans an ftp site for files
</description>
<job-class>FTP</job-class>
<job-data-map allows-transient-data="true">
<entry>
<key>FTP_HOST</key>
<value>\home\cavaness\inbound</value>
</entry>
<!-- Other neccessary Job parameters here -->
</job-data-map>
</job-detail
<trigger>
<simple>
<name>ScanFTPSiteJobTrigger</name>
<group>DEFAULT</group>
<job-name>ScanFTPSiteJob</job-name>
<job-group>DEFAULT</job-group>
<start-time>2005-09-11 6:10:00 PM</start-time>
<!-- repeat indefinitely every 60 seconds -->
<repeat-count>-1</repeat-count>
<repeat-interval>60000</repeat-interval>
</simple>
</trigger>
</job>
</quartz>

ι  ι ! "  #ι$  ι"
. 3 ι" , 4. ,


36
org.quartz.scheduler.instanceName = QuartzScheduler
org.quartz.scheduler.instanceId = AUTO
org.quartz.threadPool.threadCount = 5
org.quartz.threadPool.threadPriority = 5
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
#===============================================================
#Configure JobStore
#===============================================================
org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore
#===============================================================
#Configure Plugins
#===============================================================
org.quartz.plugin.jobInitializer.class =
org.quartz.plugins.xml.JobInitializationPlugin
org.quartz.plugin.jobInitializer.overWriteExistingJobs = true
org.quartz.plugin.jobInitializer.failOnFileNotFound = true
org.quartz.plugin.jobInitializer.validating=false

&ι 
! '  $ ι!ι(  Quartz !( 
ι  
ι 


! !' ι*, ! 


$

 ιι:
• ι! (scalability)


!  (load balancing)
•   ι
ι! 
(high availability)
• 
!
 !

(fail – over)
)   

! 
 !'
 !ι
JTA 

,
 '
 

$ quartz.properties,  
   «
ι»  Quartz !
,  

! org.quartz.scheduler.wrapJobExecutionInUserTransaction  ! true. %