Node Director
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
sfi.director.schedule.Scheduler Class Reference
Inheritance diagram for sfi.director.schedule.Scheduler:
sfi.director.schedule.SimpleScheduler sfi.director.schedule.ParallelScheduler

Public Member Functions

void claimQueue (int timeout) throws DirectorException
void claimQueue () throws DirectorException
boolean isQueueMine ()
void releaseQueue () throws DirectorException
void notifyServer () throws DirectorException
void scheduleDSUpdate (Enumeration classes) throws DirectorException
void scheduleDSUpdate (DBObject dbo) throws DirectorException
void scheduleShutdown () throws DirectorException
void scheduleRemoteHostPw (String login, String pw) throws DirectorException
void scheduleJob (Job job) throws DirectorException
void scheduleJob (Enumeration jobs) throws DirectorException
synchronized void executePendingDSUpdate ()
void goThroughCmds () throws DirectorException
void purgeOldJobs () throws DirectorException
void removeOldJobs () throws DirectorException
synchronized void goThroughQueue () throws DirectorException
abstract void goThroughVector (Vector jobs) throws DirectorException
void attach () throws DirectorException
 Start scheduler and attach it to the job queue.
synchronized void detach () throws DirectorException
 Stop scheduler and detach from the job queue.
Job getJob (String jobId)
 Get a pending job from the in-memory job queue.
Options getOptions ()
 get schedule options.
boolean isShutdown ()
 ask if we are requested to shut down.
boolean isSchedulerRunning () throws DirectorException
 ask if there is a scheduler running on our cmd/job queue.
Options getRunningSchedulerOpts () throws DirectorException
 retrieve the options of a scheduler running on our cmd/job queue.
String getRunningSchedulerId () throws DirectorException
 retrieve the ID of a scheduler running on our cmd/job queue.
String getRunningSchedulerHost () throws DirectorException
 retrieve the host of a scheduler running on our cmd/job queue.
void rescan () throws DirectorException
 do a rescan of the job/cmd queues
String getStatus ()
 return human readable status information
String dumpStatus ()
void setPriviledged (boolean priviledged)
 choose queue for the next addCmd() (schedule*()) invocation.

Static Public Member Functions

static Vector loadQueue (DBConnection queue) throws DirectorException
static Vector identifyHeads (Vector queue)

Static Public Attributes

final static String scheduleOptAttr = "sfijobschedule-option"

Protected Member Functions

void executeDSUpdate (DBObject cmd) throws DirectorException
void executeCmd (DBObject cmd, boolean priviledged) throws DirectorException
void runThroughCmdQueue (DBConnection db, boolean priviledged) throws DirectorException
void runThroughLockedQueue () throws DirectorException

Member Function Documentation

void sfi.director.schedule.Scheduler.attach ( ) throws DirectorException
void sfi.director.schedule.Scheduler.claimQueue ( int  timeout) throws DirectorException
void sfi.director.schedule.Scheduler.claimQueue ( ) throws DirectorException
synchronized void sfi.director.schedule.Scheduler.detach ( ) throws DirectorException

Stop scheduler and detach from the job queue.

Reimplemented in sfi.director.schedule.ParallelScheduler.

References sfi.director.util.Lock.unlock().

Referenced by sfi.director.cli.queueworker.run().

String sfi.director.schedule.Scheduler.dumpStatus ( )
void sfi.director.schedule.Scheduler.executeCmd ( DBObject  cmd,
boolean  priviledged 
) throws DirectorException
protected
void sfi.director.schedule.Scheduler.executeDSUpdate ( DBObject  cmd) throws DirectorException
protected
synchronized void sfi.director.schedule.Scheduler.executePendingDSUpdate ( )
Job sfi.director.schedule.Scheduler.getJob ( String  jobId)

Get a pending job from the in-memory job queue.

If the job is not held in memory return null. This explicitly will not try to retrieve a job from the jobqueue database!

Reimplemented in sfi.director.schedule.ParallelScheduler.

Referenced by sfi.director.jobs.JobMonitor.retrieveJob().

Options sfi.director.schedule.Scheduler.getOptions ( )

get schedule options.

The returned object may be manipulated by the caller.

String sfi.director.schedule.Scheduler.getRunningSchedulerHost ( ) throws DirectorException

retrieve the host of a scheduler running on our cmd/job queue.

References sfi.director.util.Options.getOption(), and sfi.director.schedule.Scheduler.getRunningSchedulerOpts().

Referenced by sfi.director.cli.serverstatus.run().

String sfi.director.schedule.Scheduler.getRunningSchedulerId ( ) throws DirectorException
Options sfi.director.schedule.Scheduler.getRunningSchedulerOpts ( ) throws DirectorException
String sfi.director.schedule.Scheduler.getStatus ( )
void sfi.director.schedule.Scheduler.goThroughCmds ( ) throws DirectorException
synchronized void sfi.director.schedule.Scheduler.goThroughQueue ( ) throws DirectorException
abstract void sfi.director.schedule.Scheduler.goThroughVector ( Vector  jobs) throws DirectorException
pure virtual
static Vector sfi.director.schedule.Scheduler.identifyHeads ( Vector  queue)
static
boolean sfi.director.schedule.Scheduler.isQueueMine ( )
boolean sfi.director.schedule.Scheduler.isSchedulerRunning ( ) throws DirectorException

ask if there is a scheduler running on our cmd/job queue.

References sfi.director.schedule.Scheduler.getRunningSchedulerId().

Referenced by sfi.director.cli.shutdown.run().

boolean sfi.director.schedule.Scheduler.isShutdown ( )

ask if we are requested to shut down.

Referenced by sfi.director.cli.queueworker.run().

static Vector sfi.director.schedule.Scheduler.loadQueue ( DBConnection  queue) throws DirectorException
static
void sfi.director.schedule.Scheduler.notifyServer ( ) throws DirectorException
void sfi.director.schedule.Scheduler.purgeOldJobs ( ) throws DirectorException
void sfi.director.schedule.Scheduler.releaseQueue ( ) throws DirectorException
void sfi.director.schedule.Scheduler.removeOldJobs ( ) throws DirectorException
void sfi.director.schedule.Scheduler.rescan ( ) throws DirectorException
void sfi.director.schedule.Scheduler.runThroughCmdQueue ( DBConnection  db,
boolean  priviledged 
) throws DirectorException
protected
void sfi.director.schedule.Scheduler.runThroughLockedQueue ( ) throws DirectorException
protected
void sfi.director.schedule.Scheduler.scheduleDSUpdate ( Enumeration  classes) throws DirectorException
void sfi.director.schedule.Scheduler.scheduleDSUpdate ( DBObject  dbo) throws DirectorException
void sfi.director.schedule.Scheduler.scheduleJob ( Job  job) throws DirectorException
void sfi.director.schedule.Scheduler.scheduleJob ( Enumeration  jobs) throws DirectorException
void sfi.director.schedule.Scheduler.scheduleRemoteHostPw ( String  login,
String  pw 
) throws DirectorException
void sfi.director.schedule.Scheduler.scheduleShutdown ( ) throws DirectorException
void sfi.director.schedule.Scheduler.setPriviledged ( boolean  priviledged)

choose queue for the next addCmd() (schedule*()) invocation.

"true" selects the priviledged (cmd) queue, "false" the unpriviledged (request) queue

Referenced by sfi.director.application.SetPassword.setPasswordByFilter().

Member Data Documentation

final static String sfi.director.schedule.Scheduler.scheduleOptAttr = "sfijobschedule-option"
static

The documentation for this class was generated from the following file: