CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions | Variables
lumidb2Schema Namespace Reference

Functions

def createBranch
 
def createIndex
 
def createLumi
 
def describeLumi
 
def dropIndex
 
def dropLumi
 
def main
 

Variables

string VERSION = '2.00'
 

Function Documentation

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

Definition at line 35 of file lumidb2Schema.py.

Referenced by main().

35 
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
Definition: start.py:1
def createBranch
Definition: revisionDML.py:432
def lumidb2Schema.createIndex (   dbsession)

Definition at line 29 of file lumidb2Schema.py.

Referenced by main().

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

Definition at line 7 of file lumidb2Schema.py.

References lumidbDDL.createTables().

Referenced by main().

7 
8 def createLumi(dbsession):
9  print 'creating lumidb2 schema...'
10  dbsession.transaction().start(False)
11  schema=dbsession.nominalSchema()
13  dbsession.transaction().commit()
Definition: start.py:1
def createTables
Definition: lumidbDDL.py:8
def lumidb2Schema.describeLumi (   dbsession)

Definition at line 21 of file lumidb2Schema.py.

Referenced by main().

21 
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()
Definition: start.py:1
def lumidb2Schema.dropIndex (   dbsession)

Definition at line 32 of file lumidb2Schema.py.

Referenced by main().

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

Definition at line 14 of file lumidb2Schema.py.

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

Referenced by main().

14 
15 def dropLumi(dbsession):
16  print 'droping lumi db2 schema...'
17  dbsession.transaction().start(False)
18  schema=dbsession.nominalSchema()
20  dbsession.transaction().commit()
Definition: start.py:1
def schemaV2Tables
Definition: nameDealer.py:5
def dropTables
Definition: lumidbDDL.py:222
def lumidb2Schema.main ( )

Definition at line 42 of file lumidb2Schema.py.

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

42 
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 :
print 'verbose mode'

Variable Documentation

string lumidb2Schema.VERSION = '2.00'

Definition at line 2 of file lumidb2Schema.py.