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 35 of file lumidb2Schema.py.

Referenced by main().

35 def createBranch(dbsession,branchname,parentname,comment):
36  print 'creating branch ',branchname
37  dbsession.transaction().start(False)
38  (branchid,parentid,parentname)=revisionDML.createBranch(dbsession.nominalSchema(),branchname,parentname,comment)
39  dbsession.transaction().commit()
40  print 'branchid ',branchid,' parentname ',parentname,' parentid ',parentid
41 
Definition: start.py:1
def createBranch(dbsession, branchname, parentname, comment)
def createBranch(schema, name, parentname, comment='')
Definition: revisionDML.py:432
def lumidb2Schema.createIndex (   dbsession)

Definition at line 29 of file lumidb2Schema.py.

Referenced by main().

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

Definition at line 7 of file lumidb2Schema.py.

References lumidbDDL.createTables().

Referenced by main().

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

Definition at line 21 of file lumidb2Schema.py.

Referenced by main().

21 def describeLumi(dbsession):
22  print 'lumi db schema dump...'
23  dbsession.transaction().start(True)
24  schema=dbsession.nominalSchema()
25  db=dbUtil.dbUtil(schema)
26  db.describeSchema()
27  dbsession.transaction().commit()
28 
Definition: start.py:1
def describeLumi(dbsession)
def lumidb2Schema.dropIndex (   dbsession)

Definition at line 32 of file lumidb2Schema.py.

Referenced by main().

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

Definition at line 14 of file lumidb2Schema.py.

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

Referenced by main().

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

Definition at line 42 of file lumidb2Schema.py.

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

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','createbranch','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  if args.action == 'createbranch':
63  createBranch(session,'TRUNK',None,'root')
64  createBranch(session,'NORM','TRUNK','hold normalization factor')
65  createBranch(session,'DATA','TRUNK','hold data')
66  if args.action == 'drop':
67  dropLumi(session)
68  if args.action == 'describe':
69  describeLumi(session)
70  if args.action == 'addindex':
71  createIndex(session)
72  if args.action == 'dropindex':
73  dropIndex(session)
74  if args.verbose :
75  print 'verbose mode'
def dropIndex(dbsession)
def createIndex(dbsession)
def createLumi(dbsession)
Definition: lumidb2Schema.py:7
def dropLumi(dbsession)
def createBranch(dbsession, branchname, parentname, comment)
def describeLumi(dbsession)

Variable Documentation

lumidb2Schema.VERSION

Definition at line 2 of file lumidb2Schema.py.