Package Ganga :: Package Core :: Package MonitoringComponent :: Module Local_GangaMC_Service :: Class JobRegistry_Monitor
[hide private]
[frames] | no frames]

Class JobRegistry_Monitor

source code

                     object --+            
                              |            
             threading._Verbose --+        
                                  |        
                   threading.Thread --+    
                                      |    
GangaRepository.SessionLock.GangaThread --+
                                          |
                                         JobRegistry_Monitor

Job monitoring service thread.

Instance Methods [hide private]
 
__init__(self, registry)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
run(self)
Main monitoring loop
source code
 
__monStep(self)
A single monitoring step in the monitoring loop Note: Internally the step does not block, it produces *actions* that are queued to be run in the thread pool
source code
 
runMonitoring(self, steps=1, timeout=60, jobs=None)
Enable/Run the monitoring loop and wait for the monitoring steps completion.
source code
 
enableMonitoring(self)
Run the monitoring loop continuously
source code
 
disableMonitoring(self)
Disable the monitoring loop
source code
 
stop(self, fail_cb=None, max_retries=5)
Stop the monitoring loop...
source code
 
__cleanUp(self)
Cleanup function ran in JobRegistry_Monitor thread to disable the monitoring loop updateDict_ts.timeoutCheck can hold timeout locks that need to be released in order to allow the pool threads to be freed.
source code
 
__isInProgress(self) source code
 
__awaitTermination(self, timeout=5)
Wait for resources to be cleaned up (threads,queue)...
source code
 
setCallbackHook(self, func, argDict, enabled, timeout=0) source code
 
removeCallbackHook(self, func) source code
 
enableCallbackHook(self, func) source code
 
disableCallbackHook(self, func) source code
 
runClientCallbacks(self) source code
 
setClientCallback(self, clientFunc, argDict) source code
 
removeClientCallback(self, clientFunc) source code
 
__defaultActiveBackendsFunc(self) source code
 
makeUpdateJobStatusFunction(self, makeActiveBackendsFunc=None) source code
 
makeCredCheckJobInsertor(self, credObj) source code
 
makeCredChecker(self, credObj) source code
 
diskSpaceCheckJobInsertor(self)
Inserts the disk space checking task in the monitoring task queue
source code
 
updateJobs(self) source code
 
_handleError(self, x, backend_name, show_traceback) source code

Inherited from GangaRepository.SessionLock.GangaThread: isCritical, setCritical, should_stop, unregister

Inherited from threading.Thread: __repr__, getName, isAlive, isDaemon, is_alive, join, setDaemon, setName, start

Inherited from threading.Thread (private): _reset_internal_locks, _set_daemon, _set_ident

Inherited from threading._Verbose (private): _note

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  uPollRate = 0.5
  minPollRate = 1.0
Properties [hide private]

Inherited from threading.Thread: daemon, ident, name

Inherited from threading.Thread (private): _block

Inherited from object: __class__

Method Details [hide private]

__init__(self, registry)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

run(self)

source code 

Main monitoring loop

Overrides: threading.Thread.run

runMonitoring(self, steps=1, timeout=60, jobs=None)

source code 

Enable/Run the monitoring loop and wait for the monitoring steps completion.
Parameters:
  steps:   number of monitoring steps to run
  timeout: how long to wait for monitor steps termination (seconds)
  jobs: a registry slice to be monitored (None -> all jobs), it may be passed by the user so ._impl is stripped if needed
Return:
  False, if the loop cannot be started or the timeout occured while waiting for monitoring termination
  True, if the monitoring steps were successfully executed  
Note:         
  This method is meant to be used in Ganga scripts to request monitoring on demand. 

stop(self, fail_cb=None, max_retries=5)

source code 

Stop the monitoring loop
Parameters:
 fail_cb : if not None, this callback is called if a retry attempt is needed

Overrides: GangaRepository.SessionLock.GangaThread.stop

__awaitTermination(self, timeout=5)

source code 

Wait for resources to be cleaned up (threads,queue)
Returns:
    False, on timeout