OperationHandlerBase

mod:OperationHandlerBase

synopsis:request operation handler base class

RMS Operation handler base class.

This should be a functor getting Operation as ctor argument and calling it (executing __call__) should return S_OK/S_ERROR.

Helper functions and tools:

  • self.rssClient() – returns RSSClient
  • self.getProxyForLFN( LFN ) – sets X509_USER_PROXY environment variable to LFN owner proxy
  • self.rssSEStatus( SE, status ) returns S_OK(True/False) depending of RSS :status:

Properties:

  • self.shifter – list of shifters matching request owner (could be empty!!!)
  • each CS option stored under CS path “RequestExecutingAgent/OperationHandlers/Foo” is exported as read-only property too
  • self.initialize() – overwrite it to perform additional initialization
  • self.log – own sub logger
  • self.request, self.operation – reference to Operation and Request itself

In all inherited class one should overwrite __call__ and initialize, when appropriate.

For monitoring purpose each of operation handler has got defined at this level three :gMonitor: activities to be used together with given operation.Type, namely operation.Type + “Att”, operation.Type + “Succ” and operation.Type + “Fail”, i.e. for operation.Type = “Foo”, they are “FooAtt”, “FooSucc”, “FooFail”. Treating of those is done automatically, but if you need to monitor more, DIY.

class DIRAC.RequestManagementSystem.private.OperationHandlerBase.OperationHandlerBase(operation=None, csPath=None)

Bases: object

class OperationHandlerBase

request operation handler base class

__init__(operation=None, csPath=None)

c’tor

Parameters:
  • operation (Operation) – Operation instance
  • csPath (str) – config path in CS for this operation
getProxyForLFN(lfn)

get proxy for lfn

Parameters:lfn (str) – LFN
Returns:S_ERROR or S_OK( “/path/to/proxy/file” )
getWaitingFilesList()

prepare waiting files list, update Attempt, filter out MaxAttempt

makeProperty(name, value, readOnly=False)

Add property :name: to class

This also creates a private :_name: attribute If you want to make read only property, set :readOnly: flag to True :warn: could raise AttributeError if :name: of :_name: is already defined as an attribute

classmethod rssClient()

ResourceStatusClient getter

rssSEStatus(se, status, retries=2)

check SE :se: for status :status:

Parameters:
  • se (str) – SE name
  • status (str) – RSS status
setOperation(operation)

operation and request setter

Parameters:operation (Operation) – operation instance
Raises:TypeError – if operation in not an instance of Operation
shifter