CMS 3D CMS Logo

Functions | Variables
lumidb2Schema Namespace Reference

Functions

def createBranch (dbsession, branchname, parentname, comment)
 
def createIndex (dbsession)
 
def createLumi (dbsession)
 
def describeLumi (dbsession)
 
def dropIndex (dbsession)
 
def dropLumi (dbsession)
 
def main ()
 

Variables

 VERSION
 

Function Documentation

def lumidb2Schema.createBranch (   dbsession,
  branchname,
  parentname,
  comment 
)

Definition at line 36 of file lumidb2Schema.py.

Referenced by main().

36 def createBranch(dbsession,branchname,parentname,comment):
37  print('creating branch ',branchname)
38  dbsession.transaction().start(False)
39  (branchid,parentid,parentname)=revisionDML.createBranch(dbsession.nominalSchema(),branchname,parentname,comment)
40  dbsession.transaction().commit()
41  print('branchid ',branchid,' parentname ',parentname,' parentid ',parentid)
42 
Definition: start.py:1
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:65
def createBranch(dbsession, branchname, parentname, comment)
def createBranch(schema, name, parentname, comment='')
Definition: revisionDML.py:433
def lumidb2Schema.createIndex (   dbsession)

Definition at line 30 of file lumidb2Schema.py.

Referenced by main().

30 def createIndex(dbsession):
31  pass
32 
def createIndex(dbsession)
def lumidb2Schema.createLumi (   dbsession)

Definition at line 8 of file lumidb2Schema.py.

References lumidbDDL.createTables(), and edm.print().

Referenced by main().

8 def createLumi(dbsession):
9  print('creating lumidb2 schema...')
10  dbsession.transaction().start(False)
11  schema=dbsession.nominalSchema()
13  dbsession.transaction().commit()
14 
Definition: start.py:1
def createTables(schema)
Definition: lumidbDDL.py:9
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:65
def createLumi(dbsession)
Definition: lumidb2Schema.py:8
def lumidb2Schema.describeLumi (   dbsession)

Definition at line 22 of file lumidb2Schema.py.

References edm.print().

Referenced by main().

22 def describeLumi(dbsession):
23  print('lumi db schema dump...')
24  dbsession.transaction().start(True)
25  schema=dbsession.nominalSchema()
26  db=dbUtil.dbUtil(schema)
27  db.describeSchema()
28  dbsession.transaction().commit()
29 
Definition: start.py:1
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:65
def describeLumi(dbsession)
def lumidb2Schema.dropIndex (   dbsession)

Definition at line 33 of file lumidb2Schema.py.

Referenced by main().

33 def dropIndex(dbsession):
34  pass
35 
def dropIndex(dbsession)
def lumidb2Schema.dropLumi (   dbsession)

Definition at line 15 of file lumidb2Schema.py.

References lumidbDDL.dropTables(), edm.print(), and nameDealer.schemaV2Tables().

Referenced by main().

15 def dropLumi(dbsession):
16  print('droping lumi db2 schema...')
17  dbsession.transaction().start(False)
18  schema=dbsession.nominalSchema()
20  dbsession.transaction().commit()
21 
Definition: start.py:1
def dropTables(schema, tablelist)
Definition: lumidbDDL.py:223
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:65
def dropLumi(dbsession)
def schemaV2Tables()
Definition: nameDealer.py:5
def lumidb2Schema.main ( )

Definition at line 43 of file lumidb2Schema.py.

References createBranch(), createIndex(), createLumi(), describeLumi(), dropIndex(), dropLumi(), and edm.print().

43 def main():
44  parser = argparse.ArgumentParser(prog=os.path.basename(sys.argv[0]),description="Lumi DB schema operations.")
45  # add the arguments
46  parser.add_argument('-c',dest='connect',action='store',required=True,help='connect string to lumiDB')
47  parser.add_argument('-P',dest='authpath',action='store',help='path to authentication file')
48  parser.add_argument('action',choices=['create','createbranch','drop','describe','addindex','dropindex'],help='action on the schema')
49  parser.add_argument('--verbose',dest='verbose',action='store_true',help='verbose')
50  parser.add_argument('--debug',dest='debug',action='store_true',help='debug mode')
51  # parse arguments
52  args=parser.parse_args()
53  connectstring=args.connect
54  if args.debug:
55  msg=coral.MessageStream('')
56  msg.setMsgVerbosity(coral.message_Level_Debug)
57  svc = coral.ConnectionService()
58  if args.authpath and len(args.authpath)!=0:
59  os.environ['CORAL_AUTH_PATH']=args.authpath
60  session=svc.connect(connectstring,accessMode=coral.access_Update)
61  if args.action == 'create':
62  createLumi(session)
63  if args.action == 'createbranch':
64  createBranch(session,'TRUNK',None,'root')
65  createBranch(session,'NORM','TRUNK','hold normalization factor')
66  createBranch(session,'DATA','TRUNK','hold data')
67  if args.action == 'drop':
68  dropLumi(session)
69  if args.action == 'describe':
70  describeLumi(session)
71  if args.action == 'addindex':
72  createIndex(session)
73  if args.action == 'dropindex':
74  dropIndex(session)
75  if args.verbose :
76  print('verbose mode')
def dropIndex(dbsession)
def createIndex(dbsession)
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:65
def createLumi(dbsession)
Definition: lumidb2Schema.py:8
def dropLumi(dbsession)
def createBranch(dbsession, branchname, parentname, comment)
def describeLumi(dbsession)

Variable Documentation

lumidb2Schema.VERSION

Definition at line 3 of file lumidb2Schema.py.