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()
print 'branchid ',branchid,' parentname ',parentname,' parentid ',parentid
Definition: start.py:1
def createBranch
Definition: revisionDML.py:430
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:209
def lumidb2Schema.main ( )

Definition at line 41 of file lumidb2Schema.py.

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

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

Variable Documentation

string lumidb2Schema.VERSION = '2.00'

Definition at line 2 of file lumidb2Schema.py.