[ 
https://issues.apache.org/jira/browse/ODE-963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13294285#comment-13294285
 ] 

Sathwik Bantwal Premakumar commented on ODE-963:
------------------------------------------------

Design approach: 
------------------------
The design is based on Strategy GOF pattern.

Configuration:
-------------------
The strategy to be used, can be configured in ode-axis2.properties file with an 
entry
ode.scheduler.jobRescheduleStrategy=<qualified name of the strategy 
implementation class>

Class descriptions:
---------------------------

JobRescheduleStrategy: Interface that needs to be implemented by algorithm 
implementers.

AbstractJobRescheduleStrategy: This class implements JobRescheduleStrategy and 
consists of a couple of common methods that can be used by the algorithm 
implementers. Algorithms can either extend this class or implement 
JobRescheduleStrategy interface.

DefaultJobRescheduleStrategy: Default algorithm currently used by the scheduler.

JobRescheduleStrategyContext: Context that encapsulates the underlying 
JobRescheduleStrategy implementation and methods to execute the underlying 
strategy. 

SchedulerConfiguration: This class is a placeholder for the scheduler 
configuration properties that are defined in ode-axis2.properties, all the 
instance variables corresponding to the static configuration properties defined 
in the SimpleScheduler class has been moved to this class.

SchedulerRuntimeInfo: Runtime information that can be used by the algorithm 
implementers to calculate the rescheduling time, based on the current load in 
the scheduler. Currently this class only holds the size of outstanding jobs, 
the idea was to also include the thread pool info used by the scheduler as 
well. But I was unable to get the thread pool statistics from the scheduler. In 
case anyone has a way to take out the thread pool info can add that information 
in this class.

SimpleScheduler: All the configuration properties which were held as instance 
variables has been moved to SchedulerConfiguration class. 
JobRescheduleStrategyContext is instantiated in the constructor of this class 
which makes use of SchedulerConfiguration to identify the strategy to be used.

Note: Earlier to this implementation the reschedule time on the job was updated 
in the SimpleScheduler. Now all the algorithm implementers have to update the 
job reschedule time in their implementation classes. Helper methods to do the 
same are provided in AbstractJobRescheduleStrategy.

Fallback mechanism:
-----------------------------
Incase there is a problem in loading the algorithm implementation class, the 
system will fallback to use DefaultJobRescheduleStrategy.
                
> Provision to configure different Job Rescheduling Algorithms to be used by 
> the Scheduler
> ----------------------------------------------------------------------------------------
>
>                 Key: ODE-963
>                 URL: https://issues.apache.org/jira/browse/ODE-963
>             Project: ODE
>          Issue Type: Improvement
>          Components: BPEL Runtime
>            Reporter: Sathwik Bantwal Premakumar
>         Attachments: ODE-963.patch
>
>
> Currently the SimpleScheduler uses the default algorithm of pow(5,retryCount) 
> to reschedule failed jobs.
> So the retires are done after 5,25,125,625,... seconds. At higher retries the 
> jobs are rescheduled after many hours or even days. This may be undesirable 
> at times and may need more efficient algorithms.
> There should be a provision to configure different job rescheduling 
> algorithms. Care should be taken to fallback on the above algorithm as the 
> default incase no algorithms are configured.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to