FTS3Operation

class DIRAC.DataManagementSystem.Client.FTS3Operation.FTS3Operation(ftsFiles=None, username=None, userGroup=None, rmsReqID=-1, rmsOpID=0, sourceSEs=None, activity=None, priority=None)

Bases: DIRAC.DataManagementSystem.private.FTS3Utilities.FTS3Serializable

Abstract class to represent an operation to be executed by FTS. It is a container for FTSFiles, as well as for FTSJobs.

There can be a mapping between one FTS3Operation and one RMS Operation.

The FTS3Operation takes care of generating the appropriate FTSJobs, and to perform a callback when the work with FTS is over. The actual generation and callback depends on the subclass.

This class should not be instantiated directly, but rather one of its subclass

ALL_STATES = ['Active', 'Processed', 'Finished', 'Canceled', 'Failed']
FINAL_STATES = ['Finished', 'Canceled', 'Failed']
INIT_STATE = 'Active'
__init__(ftsFiles=None, username=None, userGroup=None, rmsReqID=-1, rmsOpID=0, sourceSEs=None, activity=None, priority=None)
Parameters:
  • ftsFiles – list of FTS3Files object that belongs to the operation
  • username – username whose proxy should be used
  • userGroup – group that should be used with username
  • rmsReqID – ID of the Request in the RMS system
  • rmsOpID – ID of the Operation in the RMS system
  • sourceSEs – list of SE to be used as source (if applicable)
  • activity – FTS activity to use
  • priority – FTS priority to use
callback()

Trigger the callback once all the FTS interactions are done and update the status of the Operation to ‘Finished’ if successful

classmethod fromRMSObjects(rmsReq, rmsOp, username)

Construct an FTS3Operation object from the RMS Request and Operation corresponding. The attributes taken are the OwnerGroup, Request and Operation IDS, sourceSE, and activity and priority if they are defined in the Argument field of the operation :param rmsReq: RMS Request object :param rmsOp: RMS Operation object :param username: username to which associate the FTS3Operation (normally comes from the Req OwnerDN)

Returns:FTS3Operation object
init_on_load = <Mock name='mock.orm.reconstructor()' id='140553772326800'>
isTotallyProcessed()

Returns True if and only if there is nothing else to be done by FTS for this operation. All files are successful or definitely failed

prepareNewJobs(maxFilesPerJob=100, maxAttemptsPerFile=10)

Prepare the new jobs that have to be submitted

Parameters:
  • maxFilesPerJob – maximum number of files assigned to a job
  • maxAttemptsPerFile – maximum number of retry after an fts failure

:return list of jobs

toJSON(forPrint=False)

Returns the JSON formated string

Parameters:forPrint – if set to True, we don’t include the ‘magic’ arguments used for rebuilding the object
vo

returns – return vo of the usergroup

class DIRAC.DataManagementSystem.Client.FTS3Operation.FTS3StagingOperation(ftsFiles=None, username=None, userGroup=None, rmsReqID=-1, rmsOpID=0, sourceSEs=None, activity=None, priority=None)

Bases: DIRAC.DataManagementSystem.Client.FTS3Operation.FTS3Operation

Class to be used for a Staging operation

ALL_STATES = ['Active', 'Processed', 'Finished', 'Canceled', 'Failed']
FINAL_STATES = ['Finished', 'Canceled', 'Failed']
INIT_STATE = 'Active'
__init__(ftsFiles=None, username=None, userGroup=None, rmsReqID=-1, rmsOpID=0, sourceSEs=None, activity=None, priority=None)
Parameters:
  • ftsFiles – list of FTS3Files object that belongs to the operation
  • username – username whose proxy should be used
  • userGroup – group that should be used with username
  • rmsReqID – ID of the Request in the RMS system
  • rmsOpID – ID of the Operation in the RMS system
  • sourceSEs – list of SE to be used as source (if applicable)
  • activity – FTS activity to use
  • priority – FTS priority to use
callback()

Trigger the callback once all the FTS interactions are done and update the status of the Operation to ‘Finished’ if successful

classmethod fromRMSObjects(rmsReq, rmsOp, username)

Construct an FTS3Operation object from the RMS Request and Operation corresponding. The attributes taken are the OwnerGroup, Request and Operation IDS, sourceSE, and activity and priority if they are defined in the Argument field of the operation :param rmsReq: RMS Request object :param rmsOp: RMS Operation object :param username: username to which associate the FTS3Operation (normally comes from the Req OwnerDN)

Returns:FTS3Operation object
init_on_load = <Mock name='mock.orm.reconstructor()' id='140553772326800'>
isTotallyProcessed()

Returns True if and only if there is nothing else to be done by FTS for this operation. All files are successful or definitely failed

prepareNewJobs(maxFilesPerJob=100, maxAttemptsPerFile=10)

Prepare the new jobs that have to be submitted

Parameters:
  • maxFilesPerJob – maximum number of files assigned to a job
  • maxAttemptsPerFile – maximum number of retry after an fts failure

:return list of jobs

toJSON(forPrint=False)

Returns the JSON formated string

Parameters:forPrint – if set to True, we don’t include the ‘magic’ arguments used for rebuilding the object
vo

returns – return vo of the usergroup

class DIRAC.DataManagementSystem.Client.FTS3Operation.FTS3TransferOperation(ftsFiles=None, username=None, userGroup=None, rmsReqID=-1, rmsOpID=0, sourceSEs=None, activity=None, priority=None)

Bases: DIRAC.DataManagementSystem.Client.FTS3Operation.FTS3Operation

Class to be used for a Replication operation

ALL_STATES = ['Active', 'Processed', 'Finished', 'Canceled', 'Failed']
FINAL_STATES = ['Finished', 'Canceled', 'Failed']
INIT_STATE = 'Active'
__init__(ftsFiles=None, username=None, userGroup=None, rmsReqID=-1, rmsOpID=0, sourceSEs=None, activity=None, priority=None)
Parameters:
  • ftsFiles – list of FTS3Files object that belongs to the operation
  • username – username whose proxy should be used
  • userGroup – group that should be used with username
  • rmsReqID – ID of the Request in the RMS system
  • rmsOpID – ID of the Operation in the RMS system
  • sourceSEs – list of SE to be used as source (if applicable)
  • activity – FTS activity to use
  • priority – FTS priority to use
callback()

Trigger the callback once all the FTS interactions are done and update the status of the Operation to ‘Finished’ if successful

classmethod fromRMSObjects(rmsReq, rmsOp, username)

Construct an FTS3Operation object from the RMS Request and Operation corresponding. The attributes taken are the OwnerGroup, Request and Operation IDS, sourceSE, and activity and priority if they are defined in the Argument field of the operation :param rmsReq: RMS Request object :param rmsOp: RMS Operation object :param username: username to which associate the FTS3Operation (normally comes from the Req OwnerDN)

Returns:FTS3Operation object
init_on_load = <Mock name='mock.orm.reconstructor()' id='140553772326800'>
isTotallyProcessed()

Returns True if and only if there is nothing else to be done by FTS for this operation. All files are successful or definitely failed

prepareNewJobs(maxFilesPerJob=100, maxAttemptsPerFile=10)

Prepare the new jobs that have to be submitted

Parameters:
  • maxFilesPerJob – maximum number of files assigned to a job
  • maxAttemptsPerFile – maximum number of retry after an fts failure

:return list of jobs

toJSON(forPrint=False)

Returns the JSON formated string

Parameters:forPrint – if set to True, we don’t include the ‘magic’ arguments used for rebuilding the object
vo

returns – return vo of the usergroup