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()
    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 41 of file lumidb2Schema.py.

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

Variable Documentation

string lumidb2Schema::VERSION = '2.00'

Definition at line 2 of file lumidb2Schema.py.