当前位置: 首页>>代码示例>>Python>>正文


Python ChangeState.getProgress方法代码示例

本文整理汇总了Python中WMCore.RequestManager.RequestDB.Interface.Request.ChangeState.getProgress方法的典型用法代码示例。如果您正苦于以下问题:Python ChangeState.getProgress方法的具体用法?Python ChangeState.getProgress怎么用?Python ChangeState.getProgress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WMCore.RequestManager.RequestDB.Interface.Request.ChangeState的用法示例。


在下文中一共展示了ChangeState.getProgress方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: getRequest

# 需要导入模块: from WMCore.RequestManager.RequestDB.Interface.Request import ChangeState [as 别名]
# 或者: from WMCore.RequestManager.RequestDB.Interface.Request.ChangeState import getProgress [as 别名]
def getRequest(requestId, reverseTypes=None, reverseStatus=None):
    """
    _getRequest_


    retrieve a request based on the request id,
    return a ReqMgr.DataStructs.Request instance containing
    the information

    """
    factory = DBConnect.getConnection()
    reqGet = factory(classname = "Request.Get")
    reqData = reqGet.execute(requestId)
    requestName = reqData['request_name']

    if not reverseTypes or not reverseStatus:
        reverseTypes, reverseStatus = reverseLookups()

    getGroup = factory(classname = "Group.GetGroupFromAssoc")
    groupData = getGroup.execute(reqData['requestor_group_id'])

    getUser = factory(classname = "Requestor.GetUserFromAssoc")
    userData = getUser.execute(reqData['requestor_group_id'])
    request = Request()
    request["ReqMgrRequestID"] = reqData['request_id']
    request["RequestName"] = requestName
    request["RequestType"] = reverseTypes[reqData['request_type']]
    request["RequestStatus"] = reverseStatus[reqData['request_status']]
    request["RequestPriority"] = reqData['request_priority']
    request["ReqMgrRequestBasePriority"] = reqData['request_priority']
    request["RequestWorkflow"] = reqData['workflow']
    request["RequestSizeEvents"] = reqData['request_size_events']
    request["RequestSizeFiles"] = reqData['request_size_files']

    request["Group"] = groupData['group_name']
    request["ReqMgrGroupID"] = groupData['group_id']
    request["ReqMgrGroupBasePriority"] = \
                        groupData['group_base_priority']
    request["Requestor"] = userData['requestor_hn_name']
    request["ReqMgrRequestorID"] = userData['requestor_id']
    request["ReqMgrRequestorBasePriority"] = \
                                userData['requestor_base_priority']
    request["RequestPriority"] = \
      request['RequestPriority'] + groupData['group_base_priority']
    request["RequestPriority"] = \
      request['RequestPriority'] + userData['requestor_base_priority']

    updates = ChangeState.getProgress(requestName)
    request['percent_complete'], request['percent_success'] = percentages(updates)
    sqDeps = factory(classname = "Software.GetByAssoc")
    swVers = sqDeps.execute(requestId)
    request['SoftwareVersions'] = swVers.values()
    getDatasetsIn = factory(classname = "Datasets.GetInput")
    getDatasetsOut = factory(classname = "Datasets.GetOutput")
    datasetsIn = getDatasetsIn.execute(requestId)
    datasetsOut = getDatasetsOut.execute(requestId)
    request['InputDatasetTypes'] = datasetsIn
    request['InputDatasets'] = datasetsIn.keys()
    request['OutputDatasets'] = datasetsOut
    return request
开发者ID:zhiwenuil,项目名称:WMCore,代码行数:62,代码来源:GetRequest.py

示例2: getRequestDetails

# 需要导入模块: from WMCore.RequestManager.RequestDB.Interface.Request import ChangeState [as 别名]
# 或者: from WMCore.RequestManager.RequestDB.Interface.Request.ChangeState import getProgress [as 别名]
def getRequestDetails(requestName):
    """ Return a dict with the intimate details of the request """
    requestId = requestID(requestName)
    request = getRequest(requestId)
    request['Assignments'] = getAssignmentsByName(requestName)
    request['RequestMessages'] = ChangeState.getMessages(requestName)
    request['RequestUpdates'] = ChangeState.getProgress(requestName)
    return request
开发者ID:zhiwenuil,项目名称:WMCore,代码行数:10,代码来源:GetRequest.py

示例3: getRequest

# 需要导入模块: from WMCore.RequestManager.RequestDB.Interface.Request import ChangeState [as 别名]
# 或者: from WMCore.RequestManager.RequestDB.Interface.Request.ChangeState import getProgress [as 别名]
def getRequest(requestId, reverseTypes=None, reverseStatus=None):
    """
    _getRequest_


    retrieve a request based on the request id,
    return a ReqMgr.DataStructs.Request instance containing
    the information

    """
    factory = DBConnect.getConnection()
    reqGet = factory(classname = "Request.Get")
    reqData = reqGet.execute(requestId)
    requestName = reqData['request_name']

    if not reverseTypes or not reverseStatus:
        reverseTypes, reverseStatus = reverseLookups()

    getGroup = factory(classname = "Group.GetGroupFromAssoc")
    groupData = getGroup.execute(reqData['requestor_group_id'])

    getUser = factory(classname = "Requestor.GetUserFromAssoc")
    userData = getUser.execute(reqData['requestor_group_id'])
    request = Request()
    request["RequestName"] = requestName
    request["RequestType"] = reverseTypes[reqData['request_type']]
    request["RequestStatus"] = reverseStatus[reqData['request_status']]
    request["RequestPriority"] = reqData['request_priority']
    request["RequestWorkflow"] = reqData['workflow']
    request["RequestNumEvents"] = reqData['request_num_events']
    request["RequestSizeFiles"] = reqData['request_size_files']
    # there used to be RequestEventSize argument, but then SizePerEvent
    # got introduce and got adopted so this is replacing it, presenting
    # this nomenclature inconsistency on Oracle level
    request["SizePerEvent"] = reqData['request_event_size']
    request["PrepID"] = reqData['prep_id']
    
    request["Group"] = groupData['group_name']
    request["Requestor"] = userData['requestor_hn_name']

    updates = ChangeState.getProgress(requestName)
    request['percent_complete'], request['percent_success'] = percentages(updates)
    sqDeps = factory(classname = "Software.GetByAssoc")
    swVers = sqDeps.execute(requestId)
    if swVers == {}:
        request['SoftwareVersions'] = ['DEPRECATED']
    else:
        request['SoftwareVersions'] = swVers.values()

    getDatasetsIn = factory(classname = "Datasets.GetInput")
    getDatasetsOut = factory(classname = "Datasets.GetOutput")
    datasetsIn = getDatasetsIn.execute(requestId)
    datasetsOut = getDatasetsOut.execute(requestId)
    request['InputDatasetTypes'] = datasetsIn
    request['InputDatasets'] = datasetsIn.keys()
    request['OutputDatasets'] = datasetsOut
    
    # fetch AcquisitionEra from spec, it's not stored in Oracle at all
    import WMCore.HTTPFrontEnd.RequestManager.ReqMgrWebTools as Utilities
    try:
        helper = Utilities.loadWorkload(request)
        request["AcquisitionEra"] = str(helper.getAcquisitionEra())
        # add ProcessingVersion and ProcessingString in the response (#4561)
        request["ProcessingVersion"] = str(helper.getProcessingVersion())
        request["ProcessingString"] = str(helper.getProcessingString())
    except Exception, ex:
        logging.error("Could not check workload for %s, reason: %s" %
                      (request["RequestName"], ex))
开发者ID:AndrewLevin,项目名称:WMCore,代码行数:70,代码来源:GetRequest.py


注:本文中的WMCore.RequestManager.RequestDB.Interface.Request.ChangeState.getProgress方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。