本文整理汇总了Python中DIRAC.DataManagementSystem.Client.DataManager.DataManager.checkActiveReplicas方法的典型用法代码示例。如果您正苦于以下问题:Python DataManager.checkActiveReplicas方法的具体用法?Python DataManager.checkActiveReplicas怎么用?Python DataManager.checkActiveReplicas使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIRAC.DataManagementSystem.Client.DataManager.DataManager
的用法示例。
在下文中一共展示了DataManager.checkActiveReplicas方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: InputDataAgent
# 需要导入模块: from DIRAC.DataManagementSystem.Client.DataManager import DataManager [as 别名]
# 或者: from DIRAC.DataManagementSystem.Client.DataManager.DataManager import checkActiveReplicas [as 别名]
#.........这里部分代码省略.........
"""
badLFNs = []
if replicaDict.has_key( 'Successful' ):
for lfn, reps in replicaDict['Successful'].items():
if not reps:
badLFNs.append( 'LFN:%s Problem: No replicas available' % ( lfn ) )
else:
return S_ERROR( 'No replica Info available' )
if replicaDict.has_key( 'Failed' ):
for lfn, cause in replicaDict['Failed'].items():
badLFNs.append( 'LFN:%s Problem: %s' % ( lfn, cause ) )
if badLFNs:
self.log.info( 'Found %s problematic LFN(s) for job %s' % ( len( badLFNs ), job ) )
param = '\n'.join( badLFNs )
self.log.info( param )
result = self.setJobParam( job, self.am_getModuleParam( 'optimizerName' ), param )
if not result['OK']:
self.log.error( result['Message'] )
return S_ERROR( 'Input Data Not Available' )
return self.__getSiteCandidates( replicaDict['Successful'] )
#############################################################################
# FIXME: right now this is unused...
def __checkActiveSEs( self, job, replicaDict ):
"""
Check active SE and replicas and identify possible Site candidates for
the execution of the job
"""
# Now let's check if some replicas might not be available due to banned SE's
activeReplicas = self.dataManager.checkActiveReplicas( replicaDict )
if not activeReplicas['OK']:
# due to banned SE's input data might no be available
msg = "On Hold: Missing replicas due to banned SE"
self.log.info( msg )
self.log.warn( activeReplicas['Message'] )
return S_ERROR( msg )
activeReplicaDict = activeReplicas['Value']
siteCandidates = self.__checkReplicas( job, activeReplicaDict )
if not siteCandidates['OK']:
# due to a banned SE's input data is not available at a single site
msg = "On Hold: Input data not Available due to banned SE"
self.log.info( msg )
self.log.warn( siteCandidates['Message'] )
return S_ERROR( msg )
resolvedData = {}
resolvedData['Value'] = activeReplicas
resolvedData['SiteCandidates'] = siteCandidates['Value']
result = self.setOptimizerJobInfo( job, self.am_getModuleParam( 'optimizerName' ), resolvedData )
if not result['OK']:
self.log.warn( result['Message'] )
return result
return S_OK( resolvedData )
#############################################################################
def __getSitesForSE( self, se ):
""" Returns a list of sites having the given SE as a local one.
Uses the local cache of the site-se information