CMS 3D CMS Logo

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.

00036                                                          :
00037     print 'creating branch ',branchname
00038     dbsession.transaction().start(False)
00039     (branchid,parentid,parentname)=revisionDML.createBranch(dbsession.nominalSchema(),branchname,parentname,comment)
00040     dbsession.transaction().commit()
00041     print 'branchid ',branchid,' parentname ',parentname,' parentid ',parentid

def lumidb2Schema::createIndex (   dbsession)

Definition at line 29 of file lumidb2Schema.py.

00030                           :
00031     pass
    
def lumidb2Schema::createLumi (   dbsession)

Definition at line 7 of file lumidb2Schema.py.

00008                          :
00009     print 'creating lumidb2 schema...'
00010     dbsession.transaction().start(False)
00011     schema=dbsession.nominalSchema()
00012     lumidbDDL.createTables(schema)
00013     dbsession.transaction().commit()
    
def lumidb2Schema::describeLumi (   dbsession)

Definition at line 21 of file lumidb2Schema.py.

00022                            :
00023     print 'lumi db schema dump...'
00024     dbsession.transaction().start(True)
00025     schema=dbsession.nominalSchema()
00026     db=dbUtil.dbUtil(schema)
00027     db.describeSchema()
00028     dbsession.transaction().commit()

def lumidb2Schema::dropIndex (   dbsession)

Definition at line 32 of file lumidb2Schema.py.

00033                         :
00034     pass

def lumidb2Schema::dropLumi (   dbsession)

Definition at line 14 of file lumidb2Schema.py.

00015                        :
00016     print 'droping lumi db2 schema...'
00017     dbsession.transaction().start(False)
00018     schema=dbsession.nominalSchema()
00019     lumidbDDL.dropTables(schema,nameDealer.schemaV2Tables())
00020     dbsession.transaction().commit()
    
def lumidb2Schema::main ( )

Definition at line 42 of file lumidb2Schema.py.

00043           :
00044     parser = argparse.ArgumentParser(prog=os.path.basename(sys.argv[0]),description="Lumi DB schema operations.")
00045     # add the arguments
00046     parser.add_argument('-c',dest='connect',action='store',required=True,help='connect string to lumiDB')
00047     parser.add_argument('-P',dest='authpath',action='store',help='path to authentication file')
00048     parser.add_argument('action',choices=['create','createbranch','drop','describe','addindex','dropindex'],help='action on the schema')
00049     parser.add_argument('--verbose',dest='verbose',action='store_true',help='verbose')
00050     parser.add_argument('--debug',dest='debug',action='store_true',help='debug mode')
00051     # parse arguments
00052     args=parser.parse_args()
00053     connectstring=args.connect
00054     if args.debug:
00055         msg=coral.MessageStream('')
00056         msg.setMsgVerbosity(coral.message_Level_Debug)
00057     svc = coral.ConnectionService()
00058     if args.authpath and len(args.authpath)!=0:
00059         os.environ['CORAL_AUTH_PATH']=args.authpath
00060     session=svc.connect(connectstring,accessMode=coral.access_Update)
00061     if args.action == 'create':
00062         createLumi(session)
00063     if args.action == 'createbranch':
00064         createBranch(session,'TRUNK',None,'root')
00065         createBranch(session,'NORM','TRUNK','hold normalization factor')
00066         createBranch(session,'DATA','TRUNK','hold data')
00067     if args.action == 'drop':
00068        dropLumi(session)
00069     if args.action == 'describe':
00070        describeLumi(session)
00071     if args.action == 'addindex':
00072        createIndex(session)
00073     if args.action == 'dropindex':
00074        dropIndex(session)
00075     if args.verbose :
        print 'verbose mode'

Variable Documentation

string lumidb2Schema::VERSION = '2.00'

Definition at line 2 of file lumidb2Schema.py.