|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.globus.exec.monitoring.JobStateMonitor
| Field Summary | |
private static long |
CACHE_FLUSH_PERIOD
Period of time between running the cache flush task. |
private java.util.SortedSet |
cachedEvents
Time-sorted soft-state cache of events |
private java.util.TimerTask |
cacheFlushTask
Cache flushing task. |
private EventDispatchQueue |
dispatchQueue
EventDispatchQueue which will take all events that must be dispatched to avoid blocking in the JobStateMonitor |
private java.util.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 java.util.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 java.util.TimerTask |
recoveryTask
Recovery data update task. |
private SchedulerEventGenerator |
seg
Reference to the SEG-monitoring thread. |
private static java.util.Timer |
timer
Timer to handle all cache flushing and recovery timestamp update tasks. |
| Constructor Summary | |
private |
JobStateMonitor()
Private constructor |
| Method Summary | |
(package private) void |
addEvent(SchedulerEvent e)
|
private void |
cacheEvent(SchedulerEvent e)
Store an event in the JobStateMonitor's cache |
private void |
flushCache()
|
private java.util.List |
getCachedEvents(java.lang.String localId)
Get all cached events associated with a Job ID. |
static JobStateMonitor |
getInstance(java.io.File globusLocation,
java.lang.String userName,
java.lang.String schedulerName,
JobStateChangeListener listener,
JobStateRecoveryListener recoveryListener,
boolean segDaemon)
Construct a new JobStateMonitor. |
JobStateChangeListener |
getListener()
|
(package private) ResourceKey |
getMapping(java.lang.String localId)
Look up the localId to ResourceKey mapping for a specified id. |
(package private) void |
initialize(java.io.File globusLocation,
java.lang.String userName,
java.lang.String schedulerName,
JobStateChangeListener listener,
JobStateRecoveryListener recoveryListener,
SchedulerEventGenerator seg)
Initializes a new JobStateMonitor. |
void |
registerJobID(java.lang.String localId,
ResourceKey resourceKey)
Register a mapping from local scheduler job ID to a resource key. |
void |
start(java.util.Date timestamp)
Start processing SEG events. |
void |
stop()
Stop processing SEG events. |
void |
unregisterJobID(java.lang.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 EventDispatchQueue dispatchQueue
private JobStateRecoveryListener recoveryListener
private java.util.HashMap mapping
private java.util.SortedSet cachedEvents
private static final int MAX_CACHE_AGE
private static final long CACHE_FLUSH_PERIOD
private static final long RECOVERY_PERIOD
private static java.util.Timer timer
private java.util.TimerTask cacheFlushTask
private java.util.TimerTask recoveryTask
private java.util.Date lastEventTimestamp
| Constructor Detail |
private JobStateMonitor()
| Method Detail |
public static JobStateMonitor getInstance(java.io.File globusLocation,
java.lang.String userName,
java.lang.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
void initialize(java.io.File globusLocation,
java.lang.String userName,
java.lang.String schedulerName,
JobStateChangeListener listener,
JobStateRecoveryListener recoveryListener,
SchedulerEventGenerator seg)
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.seg - SchedulerEventGenerator corresponding to that JobStateMonitor
public void registerJobID(java.lang.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(java.util.Date timestamp)
throws java.lang.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.
java.lang.IllegalThreadStateException - This method has already been called.
public void stop()
throws java.io.IOException
java.io.IOExceptionprivate void flushCache()
private void updateRecoveryInfo()
private java.util.List getCachedEvents(java.lang.String localId)
localId - Job identifier to look up.
public void unregisterJobID(java.lang.String localId)
throws NotRegisteredException
localId - Local job identifier.
NotRegisteredExceptionprivate void cacheEvent(SchedulerEvent e)
ResourceKey getMapping(java.lang.String localId)
void addEvent(SchedulerEvent e)
public JobStateChangeListener getListener()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||