|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.globus.exec.monitoring.JobStateMonitor
| Nested Class Summary | |
private class |
JobStateMonitor.DispatcherThread
|
| Field Summary | |
private static long |
CACHE_FLUSH_PERIOD
Period of time between running the cache flush task. |
private SortedSet |
cachedEvents
Time-sorted soft-state cache of events |
private TimerTask |
cacheFlushTask
Cache flushing task. |
private Date |
lastEventTimestamp
Timestamp of the last dispatched event. |
private JobStateChangeListener |
listener
JobStateChangeListener which will be notified of job state changes for registered job IDs. |
private static org.apache.commons.logging.Log |
logger
|
private HashMap |
mapping
Mapping of Job IDs to Object keys |
private static int |
MAX_CACHE_AGE
Maximum age of the oldest event in the soft-state cache. |
private static long |
RECOVERY_PERIOD
Period of time between running the recovery update task. |
private JobStateRecoveryListener |
recoveryListener
JobStateRecoveryListener which will be notified when the JSM decides that its recovery information should be updated. |
private TimerTask |
recoveryTask
Recovery data update task. |
private SchedulerEventGenerator |
seg
Reference to the SEG-monitoring thread. |
private static Timer |
timer
Timer to handle all cache flushing and recovery timestamp update tasks. |
| Constructor Summary | |
JobStateMonitor(File globusLocation,
String userName,
String schedulerName,
JobStateChangeListener listener,
JobStateRecoveryListener recoveryListener)
Construct a new JobStateMonitor with a non-daemon SEG. |
|
JobStateMonitor(File globusLocation,
String userName,
String schedulerName,
JobStateChangeListener listener,
JobStateRecoveryListener recoveryListener,
boolean segDaemon)
Construct a new JobStateMonitor. |
|
| Method Summary | |
(package private) void |
addEvent(SchedulerEvent e)
|
private void |
cacheEvent(SchedulerEvent e)
Store an event in the JobStateMonitor's cache |
(package private) void |
dispatchEvent(ResourceKey resourceKey,
SchedulerEvent e)
Call the jobStateChange callback for a SEG event. |
private void |
flushCache()
|
private List |
getCachedEvents(String localId)
Get all cached events associated with a Job ID. |
private ResourceKey |
getMapping(String localId)
Look up the localId to ResourceKey mapping for a specified id. |
void |
registerJobID(String localId,
ResourceKey resourceKey)
Register a mapping from local scheduler job ID to a resource key. |
void |
start(Date timestamp)
Start processing SEG events. |
void |
stop()
Stop processing SEG events. |
void |
unregisterJobID(String localId)
Unregister a local scheduler job ID for event propagation. |
private void |
updateRecoveryInfo()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static org.apache.commons.logging.Log logger
private SchedulerEventGenerator seg
private JobStateChangeListener listener
private JobStateRecoveryListener recoveryListener
private HashMap mapping
private SortedSet cachedEvents
private static final int MAX_CACHE_AGE
private static final long CACHE_FLUSH_PERIOD
private static final long RECOVERY_PERIOD
private static Timer timer
private TimerTask cacheFlushTask
private TimerTask recoveryTask
private Date lastEventTimestamp
| Constructor Detail |
public JobStateMonitor(File globusLocation,
String userName,
String schedulerName,
JobStateChangeListener listener,
JobStateRecoveryListener recoveryListener)
globusLocation - Path to the Globus Toolkit installation.userName - User name that the SEG should run as (via sudo(8)).
(Currently ignored).schedulerName - Name of the scheduler SEG module to use.listener - Reference to the JobStateChangeListener which will be notified
when notifications relating to Job ID which has a mapping
registered to it.recoveryListener - Reference to a JobStateRecoveryListener which will be notified
periodically when the JobStateMonitor wants to update its recovery
checkpoint timestamp.
public JobStateMonitor(File globusLocation,
String userName,
String schedulerName,
JobStateChangeListener listener,
JobStateRecoveryListener recoveryListener,
boolean segDaemon)
globusLocation - Path to the Globus Toolkit installation.userName - User name that the SEG should run as (via sudo(8)).
(Currently ignored).schedulerName - Name of the scheduler SEG module to use.listener - Reference to the JobStateChangeListener which will be notified
when notifications relating to Job ID which has a mapping
registered to it.recoveryListener - Reference to a JobStateRecoveryListener which will be notified
periodically when the JobStateMonitor wants to update its recovery
checkpoint timestamp.segDaemon - Indicates whether to make the SEG a daemon thread or not| Method Detail |
public void registerJobID(String localId,
ResourceKey resourceKey)
throws AlreadyRegisteredException
localId - Local job identifier. This is presumably generated by the
scheduler when the job is created.resourceKey - Resource key associated with the job. This object will be
passed to the JobStateChangeListener's jobStateChange method.
AlreadyRegisteredException
public void start(Date timestamp)
throws IllegalThreadStateException
timestamp - Date from which to start processing events. If null, then
the SEG will process events generated from the time the function
is called.
IllegalThreadStateException - This method has already been called.
public void stop()
throws IOException
IOExceptionprivate void flushCache()
private void updateRecoveryInfo()
private List getCachedEvents(String localId)
localId - Job identifier to look up.
public void unregisterJobID(String localId)
throws NotRegisteredException
localId - Local job identifier.
NotRegisteredExceptionprivate void cacheEvent(SchedulerEvent e)
private ResourceKey getMapping(String localId)
void addEvent(SchedulerEvent e)
void dispatchEvent(ResourceKey resourceKey,
SchedulerEvent e)
resourceKey - Resource key associated with the job ID in the event.e - Event containing the job state change information.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||