TransformationPlugin

TransformationPlugin is a class wrapping the supported transformation plugins

New plugins can be created by defining a function. The function name has to be _MyPlugin, and the plugin is then call 'MyPlugin'. Do not forget to enable new plugins in the Operations/Transformation/AllowedPlugins list. The return value of the function has to be S_OK with a list of tuples. Each Tuple is a pair of a StorageElement and list of LFNs to treat in given task:

return S_OK([('SE_1', [lfn_1_1, lfn_1_2, ...]),
             ('SE_1', [lfn_2_1, lfn_2_2, ...]),
             # ...
             ('SE_I', [lfn_J_1, lfn_J_2, ...]),
             ])

Inside the plugin function, the relevant LFNs can be accessed in the self.data dictionary, and transformation parameters are obtained contained in the self.params dictionary. See also the PluginUtilities class.

class DIRAC.TransformationSystem.Agent.TransformationPlugin.TransformationPlugin(plugin, transClient=None, dataManager=None, fc=None)

Bases: DIRAC.TransformationSystem.Client.PluginBase.PluginBase

A TransformationPlugin object should be instantiated by every transformation.

Parameters:
  • plugin (str) – A plugin name has to be passed in: it will then be executed as one of the functions below, e.g. plugin = ‘BySize’ will execute TransformationPlugin(‘BySize’)._BySize()
  • transClient – TransformationManagerClient instance
  • dataManager – DataManager instance
  • fc – FileCatalog instance
__init__(plugin, transClient=None, dataManager=None, fc=None)

Constructor of the TransformationPlugin.

Instantiate clients, if not given, and set up the PluginUtilities.

isOK()

Check if all information is present

run()

this is a wrapper to invoke the plugin (self._%s()” % self.plugin)

setInputData(data)

Set the replica information as data member

setParameters(params)

Need to pass parameters also to self.util

setTransformationFiles(files)

Set the TS files as data member