Exemplo n.º 1
0
    def __call__(self, node):
        """
        _operator(node)_

        Operate on all output datasets in a Payload Node

        """
        for dataset in node._OutputDatasets:
            if dataset.has_key("NoMerge"):
                #  //
                # // If we need to avoid merging some datasets we
                #//  can add a NoMerge key and this will ignore it
                continue
            newDataset = DatasetInfo()
            newDataset.update(dataset)                
            newDataset["ApplicationFamily"] = self.mergeModuleName
            newDataset["ApplicationName"] = self.appName
            newDataset["ApplicationVersion"] = node.application['Version']
            procName = dataset["ProcessedDataset"]
            if procName.endswith("-unmerged"):
                procName = procName.replace("-unmerged", "")
            else:
                procName = "%s-merged" % procName
            newDataset["ProcessedDataset"] = procName
            newDataset["ParentDataset"] = dataset.name()
            newDataset['OutputModuleName'] = "%s-Merged" % (
                newDataset['OutputModuleName'],)
            if node.userSandbox != None:
                newDataset['UserSandbox'] = node.userSandbox
            self.result.append(newDataset)

        return
Exemplo n.º 2
0
def getOutputDatasetsWithPSet(payloadNode, sorted=False):
    """
    _getOutputDatasetsWithPSet_

    Extract all the information about output datasets from the
    payloadNode object provided, including the {{}} format PSet cfg

    Returns a list of DatasetInfo objects including App details
    from the node.

    """
    result = []

    for item in payloadNode._OutputDatasets:
        resultEntry = DatasetInfo()
        resultEntry.update(item)
        resultEntry["ApplicationName"] = payloadNode.application['Executable']
        resultEntry["ApplicationProject"] = payloadNode.application['Project']
        resultEntry["ApplicationVersion"] = payloadNode.application['Version']
        resultEntry["ApplicationFamily"] = item.get("OutputModuleName",
                                                    "AppFamily")

        try:
            config = payloadNode.cfgInterface
            psetStr = config.originalContent()
            resultEntry['PSetContent'] = psetStr
            resultEntry['Conditions'] = config.conditionsTag
        except Exception, ex:
            resultEntry['PSetContent'] = None

        result.append(resultEntry)
Exemplo n.º 3
0
def getOutputDatasetsWithPSet(payloadNode, sorted = False):
    """
    _getOutputDatasetsWithPSet_

    Extract all the information about output datasets from the
    payloadNode object provided, including the {{}} format PSet cfg

    Returns a list of DatasetInfo objects including App details
    from the node.

    """
    result = []
    
    for item in payloadNode._OutputDatasets:
        resultEntry = DatasetInfo()
        resultEntry.update(item)
        resultEntry["ApplicationName"] = payloadNode.application['Executable']
        resultEntry["ApplicationProject"] = payloadNode.application['Project']
        resultEntry["ApplicationVersion"] = payloadNode.application['Version']
        resultEntry["ApplicationFamily"] = item.get("OutputModuleName", "AppFamily")
        
        try:
            config = payloadNode.cfgInterface
            psetStr = config.originalContent()
            resultEntry['PSetContent'] = psetStr
            resultEntry['Conditions'] = config.conditionsTag
        except Exception, ex:
            resultEntry['PSetContent'] = None
        
        result.append(resultEntry)
Exemplo n.º 4
0
def expandDatasetInfo(datasetInfo, requestTimestamp):
    """
    _expandDatasetInfo_

    Given a DatasetInfo, check to see if it contains multi tiers,
    and if it does, expand them to a list of basic tier dataset info objects

    returns a list of datasetInfo objects

    """
    result = []
    if not isMultiTier(datasetInfo['DataTier']):
        #  //
        # // No multi tier, return same object as only entry in list
        #//
        result.append(datasetInfo)
        return result

    tiers = splitMultiTier(datasetInfo['DataTier'])
    processedDSName = "%s-%s-%s" % (datasetInfo['ApplicationVersion'],
                                    datasetInfo['OutputModuleName'],
                                    requestTimestamp)
    for tier in tiers:
        newInfo = DatasetInfo()
        newInfo.update(datasetInfo)
        newInfo['DataTier'] = tier
        newInfo['ProcessedDataset'] = processedDSName
        result.append(newInfo)
    return result
Exemplo n.º 5
0
def expandDatasetInfo(datasetInfo, requestTimestamp):
    """
    _expandDatasetInfo_

    Given a DatasetInfo, check to see if it contains multi tiers,
    and if it does, expand them to a list of basic tier dataset info objects

    returns a list of datasetInfo objects

    """
    result = []
    if not isMultiTier(datasetInfo['DataTier']):
        #  //
        # // No multi tier, return same object as only entry in list
        #//
        result.append(datasetInfo)
        return result
    
    tiers = splitMultiTier(datasetInfo['DataTier'])
    processedDSName = "%s-%s-%s" % (datasetInfo['ApplicationVersion'],
                                    datasetInfo['OutputModuleName'],
                                    requestTimestamp)
    for tier in tiers:
        newInfo = DatasetInfo()
        newInfo.update(datasetInfo)
        newInfo['DataTier'] = tier
        newInfo['ProcessedDataset'] = processedDSName
        result.append(newInfo)
    return result
Exemplo n.º 6
0
    def __call__(self, node):
        """
        _operator(node)_

        Operate on all output datasets in a Payload Node

        """
        for dataset in node._OutputDatasets:
            if dataset.has_key("NoMerge"):
                #  //
                # // If we need to avoid merging some datasets we
                #//  can add a NoMerge key and this will ignore it
                continue
            newDataset = DatasetInfo()
            newDataset.update(dataset)
            newDataset["ApplicationFamily"] = self.mergeModuleName
            newDataset["ApplicationName"] = self.appName
            newDataset["ApplicationVersion"] = node.application['Version']
            procName = dataset["ProcessedDataset"]
            if procName.endswith("-unmerged"):
                procName = procName.replace("-unmerged", "")
            else:
                procName = "%s-merged" % procName
            newDataset["ProcessedDataset"] = procName
            newDataset["ParentDataset"] = dataset.name()
            newDataset['OutputModuleName'] = "%s-Merged" % (
                newDataset['OutputModuleName'], )
            if node.userSandbox != None:
                newDataset['UserSandbox'] = node.userSandbox
            self.result.append(newDataset)

        return
Exemplo n.º 7
0
def getPileupDatasets(payloadNode):
    """
    _getPileupDatasets_

    Extract all pileup dataset info from the node provided.
    Returns a list of dataset info objects

    """
    result = []
    for item in payloadNode._PileupDatasets:
        resultEntry = DatasetInfo()
        resultEntry.update(item)
        resultEntry['NodeName'] = payloadNode.name
        result.append(resultEntry)
    return result
Exemplo n.º 8
0
def getPileupDatasets(payloadNode):
    """
    _getPileupDatasets_

    Extract all pileup dataset info from the node provided.
    Returns a list of dataset info objects

    """
    result = []
    for item in payloadNode._PileupDatasets:
        resultEntry = DatasetInfo()
        resultEntry.update(item)
        resultEntry['NodeName'] = payloadNode.name
        result.append(resultEntry)
    return result
Exemplo n.º 9
0
def getInputDatasets(payloadNode, sorted = False):
    """
    _getInputDatasets_

    Extract all the information about input datasets from the
    payloadNode object provided.

    Returns a list of DatasetInfo objects including App details
    from the node.

    """
    result = []
    for item in payloadNode._InputDatasets:
        resultEntry = DatasetInfo()
        resultEntry.update(item)
        result.append(resultEntry)
    if sorted:
        result = _sortDatasets(result)
    return result
Exemplo n.º 10
0
def getInputDatasets(payloadNode, sorted=False):
    """
    _getInputDatasets_

    Extract all the information about input datasets from the
    payloadNode object provided.

    Returns a list of DatasetInfo objects including App details
    from the node.

    """
    result = []
    for item in payloadNode._InputDatasets:
        resultEntry = DatasetInfo()
        resultEntry.update(item)
        result.append(resultEntry)
    if sorted:
        result = _sortDatasets(result)
    return result
Exemplo n.º 11
0
def getOutputDatasets(payloadNode, sorted = False):
    """
    _getOutputDatasets_

    Extract all the information about output datasets from the
    payloadNode object provided.

    Returns a list of DatasetInfo objects including App details
    from the node.

    """
    result = []
    
    for item in payloadNode._OutputDatasets:
        resultEntry = DatasetInfo()
        resultEntry.update(item)
        resultEntry["ApplicationName"] = payloadNode.application['Executable']
        resultEntry["ApplicationProject"] = payloadNode.application['Project']
        resultEntry["ApplicationVersion"] = payloadNode.application['Version']
        result.append(resultEntry)
    
    if sorted:
        result = _sortDatasets(result)
    return result
Exemplo n.º 12
0
def getOutputDatasets(payloadNode, sorted=False):
    """
    _getOutputDatasets_

    Extract all the information about output datasets from the
    payloadNode object provided.

    Returns a list of DatasetInfo objects including App details
    from the node.

    """
    result = []

    for item in payloadNode._OutputDatasets:
        resultEntry = DatasetInfo()
        resultEntry.update(item)
        resultEntry["ApplicationName"] = payloadNode.application['Executable']
        resultEntry["ApplicationProject"] = payloadNode.application['Project']
        resultEntry["ApplicationVersion"] = payloadNode.application['Version']
        result.append(resultEntry)

    if sorted:
        result = _sortDatasets(result)
    return result