unm.maui.sched
Interface Scheduler

All Superinterfaces:
MauiRunnable, java.lang.Runnable
All Known Implementing Classes:
Sched

public interface Scheduler
extends MauiRunnable

Scheduler interface.


Field Summary
static int FLAG_FLUSH
          Stop/flush scheduler.
static int FLAG_RUN
          Run scheduler.
static int FLAG_STOP
          Stop scheduler.
 
Method Summary
 void addSchedListener(SchedListener listener)
          Add a SchedListener.
 void cancelJob(java.lang.String id)
          Cancel a job.
 void cancelReservation(java.lang.String resID)
          Cancel a container reservation.
 void cancelSoftReservations()
          Cancel all "soft" reservations.
 boolean checkAdmin(java.lang.String admin)
          Check administrator.
 void deferJob(java.lang.String id)
          Defer a job.
 Node[] getAllNodes()
          Get all the nodes.
 MauiDB getDB()
          Get database object.
 java.util.Hashtable getDeferredHash()
          Get the deferred jobs hashtable.
 java.util.Hashtable getDoneHash()
          Get the completed/cancelled jobs/reservations hashtable.
 Matcher getGeometryMatcher()
          Get the geometry matcher.
 java.util.Hashtable getHoldHash()
          Get the held jobs hashtable.
 HashTree getQueue()
          Get the jobs queue.
 Reservation[] getReservations()
          Get Reservations.
 HashTree getReservationTree()
          Get Reservation Tree.
 RM getRM()
          Get resource manager.
 java.util.Hashtable getRunHash()
          Get the running jobs hashtable.
 void holdJob(java.lang.String id)
          Hold a job.
 boolean isIdle()
          Check if scheduler is idle.
 boolean isPause()
          Check if scheduler paused.
 Job job(java.lang.String id)
          Get the job for the given id.
 java.lang.String makeReservation(Sys c, long starttime)
          Make a reservation.
 void prioritize()
          Run prioritizer routines.
 void purgeJob(java.lang.String id)
          Purge job (only if job has finished or was cancelled).
 void purgeReservation(java.lang.String resID)
          Purge reservation (only if res has finished or was cancelled).
 void releaseJob(java.lang.String id)
          Release job hold.
 void removeSchedListener(SchedListener listener)
          Remove a SchedListener.
 Reservation reservation(java.lang.String resID)
          Get the reservation for the given id.
 void setDB(MauiDB db)
          Set database object.
 void setPause(boolean pause)
          Pause/unpause scheduler.
 void setSchedFinished(int flag)
          Set the scheduler stop flag.
 void submitJob(Job job)
          Submit a job to the scheduler.
 void submitJob(Job job, boolean block)
          Submit a job to the scheduler.
 
Methods inherited from interface unm.maui.MauiRunnable
assignProperties
 
Methods inherited from interface java.lang.Runnable
run
 

Field Detail

FLAG_RUN

public static final int FLAG_RUN
Run scheduler.

See Also:
Constant Field Values

FLAG_STOP

public static final int FLAG_STOP
Stop scheduler.

See Also:
Constant Field Values

FLAG_FLUSH

public static final int FLAG_FLUSH
Stop/flush scheduler.

See Also:
Constant Field Values
Method Detail

setDB

public void setDB(MauiDB db)
Set database object.

Parameters:
db - MauiDB

getDB

public MauiDB getDB()
Get database object.

Returns:
MauiDB

deferJob

public void deferJob(java.lang.String id)
              throws MauiException
Defer a job.

Parameters:
id - String
Throws:
SchedException
MauiException

holdJob

public void holdJob(java.lang.String id)
             throws MauiException
Hold a job.

Parameters:
id - String
Throws:
SchedException
MauiException

releaseJob

public void releaseJob(java.lang.String id)
                throws MauiException
Release job hold.

Parameters:
id - String
Throws:
SchedException
MauiException

cancelJob

public void cancelJob(java.lang.String id)
               throws MauiException
Cancel a job.

Parameters:
id - String
Throws:
SchedException
MauiException

purgeJob

public void purgeJob(java.lang.String id)
Purge job (only if job has finished or was cancelled).

Parameters:
id - String

purgeReservation

public void purgeReservation(java.lang.String resID)
Purge reservation (only if res has finished or was cancelled).

Parameters:
resID - String

submitJob

public void submitJob(Job job)
               throws MauiException
Submit a job to the scheduler.

Parameters:
job - Job
Throws:
SchedException
MauiException

submitJob

public void submitJob(Job job,
                      boolean block)
               throws MauiException
Submit a job to the scheduler.

Parameters:
job - Job
block - block job until completed/errored ?
Throws:
SchedException
MauiException

makeReservation

public java.lang.String makeReservation(Sys c,
                                        long starttime)
                                 throws MauiException
Make a reservation.

Parameters:
c - Sys
starttime - requested starttime
Returns:
String reservation id
Throws:
SchedException
MauiException

cancelReservation

public void cancelReservation(java.lang.String resID)
                       throws MauiException
Cancel a container reservation.

Parameters:
resID - String
Throws:
SchedException
MauiException

cancelSoftReservations

public void cancelSoftReservations()
Cancel all "soft" reservations.

Soft reservations are JobReservations which aren't currently active.


setSchedFinished

public void setSchedFinished(int flag)
                      throws MauiException
Set the scheduler stop flag.

Throws:
MauiException

getQueue

public HashTree getQueue()
Get the jobs queue.

Returns:
HashTree

getRunHash

public java.util.Hashtable getRunHash()
Get the running jobs hashtable.

Returns:
Hashtable

getDeferredHash

public java.util.Hashtable getDeferredHash()
Get the deferred jobs hashtable.

Returns:
Hashtable

getHoldHash

public java.util.Hashtable getHoldHash()
Get the held jobs hashtable.

Returns:
Hashtable

getDoneHash

public java.util.Hashtable getDoneHash()
Get the completed/cancelled jobs/reservations hashtable.

Returns:
Hashtable

getReservations

public Reservation[] getReservations()
Get Reservations.

Returns:
Reservation[]

getReservationTree

public HashTree getReservationTree()
Get Reservation Tree.

Returns:
HashTree

getRM

public RM getRM()
Get resource manager.

Returns:
RM

getAllNodes

public Node[] getAllNodes()
Get all the nodes.

Returns:
Node[]

getGeometryMatcher

public Matcher getGeometryMatcher()
Get the geometry matcher.

Returns:
Matcher

job

public Job job(java.lang.String id)
        throws MauiException
Get the job for the given id.

Parameters:
id - String
Returns:
Job or null if not found
Throws:
SchedException
MauiException

reservation

public Reservation reservation(java.lang.String resID)
                        throws MauiException
Get the reservation for the given id.

Parameters:
resID - String
Returns:
Reservation or null if not found
Throws:
SchedException
MauiException

prioritize

public void prioritize()
                throws MauiException
Run prioritizer routines.

Throws:
MauiException

checkAdmin

public boolean checkAdmin(java.lang.String admin)
Check administrator.

Parameters:
admin - administrator name
Returns:
true if admin is listed as a scheduler administrator

setPause

public void setPause(boolean pause)
Pause/unpause scheduler.

Parameters:
pause -

isPause

public boolean isPause()
Check if scheduler paused.

Returns:
boolean

isIdle

public boolean isIdle()
Check if scheduler is idle.

Returns:
boolean

addSchedListener

public void addSchedListener(SchedListener listener)
Add a SchedListener.

Parameters:
listener - SchedListener

removeSchedListener

public void removeSchedListener(SchedListener listener)
Remove a SchedListener.

Parameters:
listener - SchedListener