StorageManagerHandler

StorageManagerHandler is the implementation of the StorageManagementDB in the DISET framework

class DIRAC.StorageManagementSystem.Service.StorageManagerHandler.StorageManagerHandler(handlerInitDict, trid)

Bases: DIRAC.Core.DISET.RequestHandler.RequestHandler

exception ConnectionError(msg)

Bases: exceptions.Exception

__init__(msg)

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

args
message
__init__(handlerInitDict, trid)

Constructor

Parameters:
  • handlerInitDict (dictionary) – Information vars for the service
  • trid (object) – Transport to use
auth_ping = ['all']
static export_echo(data)

This method used for testing the performance of a service

export_getAssociatedReplicas(replicaIDs)

Retrieve the list of Replicas that belong to the same Tasks as the provided list

export_getCacheReplicas(condDict, older=None, newer=None, timeStamp='LastUpdate', orderAttribute=None, limit=None)

Get the replcias known to the DB.

export_getCacheReplicasSummary()

Reports breakdown of file number/size in different staging states across storage elements

export_getOfflineReplicas()

This method obtains the replicas for which all replicas in the task are Offline

export_getReplicasWithStatus(status)

This method allows to retrieve replicas with the supplied status

export_getStageRequests(condDict, older=None, newer=None, timeStamp='StageRequestSubmitTime', orderAttribute=None, limit=None)

Get the replcias known to the DB.

export_getStageSubmittedReplicas()

This method obtains the replica metadata and the stage requestID for the replicas in StageSubmitted status

export_getStagedReplicas()

This method obtains the replicas for which all replicas in the task are Staged/StageSubmitted

export_getSubmittedStagePins()

This method obtains the number of files and size of the requests submitted for each storage element

export_getTaskInfo(taskID)

Obtain the metadata of the stage task from the DB.

export_getTaskStatus(taskID)

Obtain the status of the stage task from the DB.

export_getTaskSummary(taskID)

Obtain the summary of the stage task from the DB.

export_getTasks(condDict, older=None, newer=None, timeStamp='LastUpdate', orderAttribute=None, limit=None)

Get the replicas known to the DB.

export_getTasksWithStatus(status)

This method allows to retrieve Tasks with the supplied status

export_getWaitingReplicas()

This method obtains the replicas for which all replicas in the task are Waiting

export_insertStageRequest(requestReplicas, pinLifetime)

This method inserts the stage request ID assocaited to supplied replicaIDs

export_killTasksBySourceTaskID(sourceTaskIDs)

Given SourceTaskIDs (jobIDs), this will cancel further staging of files for the corresponding tasks

export_ping()
export_removeStageRequests(replicaIDs)
export_removeTasks(taskIDs)

This method removes the entries from TaskReplicas and Tasks with the supplied task IDs

export_removeUnlinkedReplicas()

This method removes Replicas which have no associated Tasks

export_setOldTasksAsFailed(daysOld)

Set Tasks older than “daysOld” number of days to Failed These tasks have already been retried every day for staging

export_setRequest(lfnDict, source, callbackMethod, taskID)

This method allows stage requests to be set into the StagerDB

export_setStageComplete(replicaIDs)

This method updates the status of the stage request for the supplied replica IDs

export_setTasksDone(taskIDs)

This method sets the status in the Tasks table to Done for the list of supplied task IDs

export_updateReplicaFailure(replicaFailures)

This method sets the status of the replica to failed with the supplied reason

export_updateReplicaInformation(replicaTuples)

This method sets the pfn and size for the supplied replicas

export_updateReplicaStatus(replicaIDs, newReplicaStatus)

This allows to update the status of replicas

export_updateTaskStatus(sourceID, status, successful=[], failed=[])

An example to show the usage of the callbacks.

export_wakeupOldRequests(oldRequests, retryInterval)

get only StageRequests with StageRequestSubmitTime older than 1 day AND are still not staged delete these requests reset Replicas with corresponding ReplicaIDs to Status=’New’

classmethod getCSOption(optionName, defaultValue=False)

Get an option from the CS section of the services

Returns:Value for serviceSection/optionName in the CS being defaultValue the default
getRemoteAddress()

Get the address of the remote peer.

Returns:Address of remote peer.
getRemoteCredentials()

Get the credentials of the remote peer.

Returns:Credentials dictionary of remote peer.
initialize()

Initialize this instance of the handler (to be overwritten)

srv_disconnect(trid=None)
classmethod srv_disconnectClient(trid)
srv_getActionTuple()
classmethod srv_getCSOption(optionName, defaultValue=False)

Get an option from the CS section of the services

Returns:Value for serviceSection/optionName in the CS being defaultValue the default
srv_getClientSetup()
srv_getClientVO()
srv_getFormattedRemoteCredentials()
classmethod srv_getMonitor()
srv_getRemoteAddress()

Get the address of the remote peer.

Returns:Address of remote peer.
srv_getRemoteCredentials()

Get the credentials of the remote peer.

Returns:Credentials dictionary of remote peer.
classmethod srv_getServiceName()
srv_getTransportID()
classmethod srv_getURL()
classmethod srv_msgCreate(msgName)
srv_msgReply(msgObj)
classmethod srv_msgSend(trid, msgObj)
transfer_bulkFromClient(bulkId, token, bulkSize, fileHelper)
transfer_bulkToClient(bulkId, token, fileHelper)
transfer_fromClient(fileId, token, fileSize, fileHelper)
transfer_listBulk(bulkId, token, fileHelper)
transfer_toClient(fileId, token, fileHelper)
types_echo = [<type 'basestring'>]
types_getAssociatedReplicas = [<type 'list'>]
types_getCacheReplicas = [<type 'dict'>]
types_getCacheReplicasSummary = []
types_getOfflineReplicas = []
types_getReplicasWithStatus = [(<type 'str'>, <type 'unicode'>)]
types_getStageRequests = [<type 'dict'>]
types_getStageSubmittedReplicas = []
types_getStagedReplicas = []
types_getSubmittedStagePins = []
types_getTaskInfo = [<type 'int'>]
types_getTaskStatus = [<type 'int'>]
types_getTaskSummary = [<type 'int'>]
types_getTasks = [<type 'dict'>]
types_getTasksWithStatus = [(<type 'str'>, <type 'unicode'>)]
types_getWaitingReplicas = []
types_insertStageRequest = [<type 'dict'>, [<type 'int'>, <type 'long'>]]
types_killTasksBySourceTaskID = [<type 'list'>]
types_ping = []
types_removeStageRequests = [<type 'list'>]
types_removeTasks = [<type 'list'>]
types_removeUnlinkedReplicas = []
types_setOldTasksAsFailed = [<type 'int'>]
types_setRequest = [<type 'dict'>, (<type 'str'>, <type 'unicode'>), (<type 'str'>, <type 'unicode'>), <type 'int'>]
types_setStageComplete = [<type 'list'>]
types_setTasksDone = [<type 'list'>]
types_updateReplicaFailure = [<type 'dict'>]
types_updateReplicaInformation = [<type 'list'>]
types_updateReplicaStatus = [<type 'list'>, (<type 'str'>, <type 'unicode'>)]
types_updateTaskStatus = []
types_wakeupOldRequests = [<type 'list'>, <type 'int'>]
DIRAC.StorageManagementSystem.Service.StorageManagerHandler.initializeStorageManagerHandler(serviceInfo)