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
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)
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)
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
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
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
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
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
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
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
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
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