Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:50:51

0001 from __future__ import print_function
0002 import DLFCN, sys, os, time
0003 sys.setdlopenflags(DLFCN.RTLD_GLOBAL+DLFCN.RTLD_LAZY)
0004 
0005 from pluginCondDBPyInterface import *
0006 a = FWIncantation()
0007 #os.putenv("CORAL_AUTH_PATH","/afs/cern.ch/cms/DB/conddb")
0008 
0009 
0010 
0011 # rdbms = RDBMS()
0012 rdbms = RDBMS("/afs/cern.ch/cms/DB/conddb")
0013 logName = "oracle://cms_orcoff_prod/CMS_COND_31X_POPCONLOG"
0014 gdbName = "oracle://cms_orcoff_prod/CMS_COND_31X_GLOBALTAG"
0015 # gName = "GR09_31X_V6P::All"
0016 gName = 'CRAFT09_R_V9::All'
0017 #gName = 'STARTUP3X_V8F::All'
0018 rdbms.setLogger(logName)
0019 #globalTag = rdbms.globalTag(gdbName,gName,"","")
0020 # globalTag = rdbms.globalTag(gdbName,gName,"oracle://cms_orcoff_prod/","")
0021 globalTag = rdbms.globalTag(gdbName,gName,"frontier://FrontierArc/","_0911")
0022 
0023 for tag in globalTag.elements:
0024 #    dbname = tag.pfn[tag.pfn.rfind('/'):]
0025 #    db_o = rdbms.getDB("oracle://cms_orcoff_prod"+dbname)
0026     db = rdbms.getDB(tag.pfn)
0027     log = db.lastLogEntry(tag.tag)
0028     iov = db.iov(tag.tag)
0029     iov.tail(1)
0030     for elem in iov.elements :
0031         lastSince = elem.since()
0032     print(tag.record,tag.label,tag.pfn,tag.tag)
0033     print(iov.size(), iov.revision(), time.asctime(time.gmtime(unpackTime(iov.timestamp())[0])), iov.comment(), lastSince)
0034     print(log.getState())
0035     iov=0
0036     db=0
0037 
0038 
0039 def iovSize(rdbms,conn,tag) :
0040     try :
0041         db = rdbms.getDB(conn)
0042         log = db.lastLogEntry(tag)
0043         iov = db.iov(tag)
0044         size = iov.size()
0045         for elem in iov.elements :
0046             if (elem.till()>4294967295) : 
0047                 print(tag, elem.since(), elem.till(), elem.payloadToken())
0048     except RuntimeError :
0049         print(conn, tag," no iov?")
0050         size=-1
0051     iov=0
0052     db=0
0053     return size
0054 
0055 
0056 
0057