2 HCE project, Python bindings, Distributed Tasks Manager application. 3 SystemCommandHandler Class content main functional support different system command. 6 @file SystemCommandHandler.py 7 @author Alexander Vybornyh <alexander.hce.cluster@gmail.com> 8 @link: http://hierarchical-cluster-engine.com/ 9 @copyright: Copyright © 2013-2016 IOIX Ukraine 10 @license: http://hierarchical-cluster-engine.com/license/ 22 ERROR_NOT_SUPPORTED_TYPE =
'Not supported type of SystemCommandHandler' 40 def execute(self, typeNumber, inputData=None):
43 if self.
logger is not None:
44 self.
logger.debug(
'type: ' + str(typeNumber))
47 if int(typeNumber) >= len(self.
handlers)
or int(typeNumber) < 0:
50 (self.
handlers[int(typeNumber)])(inputData)
52 except Exception, err:
63 if self.
logger is not None:
64 self.
logger.debug(
'Memory usage: %s (kb)' % resource.getrusage(resource.RUSAGE_SELF).ru_maxrss)
65 self.
logger.debug(
'GC generations count: ' + str(gc.get_count()))
string ERROR_NOT_SUPPORTED_TYPE
Constans of error messages.
def execute(self, typeNumber, inputData=None)
Execute system command.
Class SystemCommandHandler for support different system command.
int ERROR_OK
Constans error codes.
def __init__(self, logger=None)
Constructor.
def onGarbageCollectorCleanupHandler(self, inputData=None)
Handler of garbage collector cleanup.