Trees | Index | Help |
|
---|
Module ESManager :: Class ESManager |
|
ESFileTypes
--+ |SQLUtil
--+ |ESInit
--+ | ESManager
Method Summary | |
---|---|
Initialize database pointer, cursor, db type (MySQL or SQLite). | |
Check if we can add given files to DB, to be allowed they should contain non-overlaping data among themselves and with EventStore DB. | |
tuple |
Check if run/data from provided fileList are unique |
none |
First thing during injection we need to check if provided list of parents is already present in DB, otherwise we need to inject parent's information. |
integer |
Verify that versioning information either setup throguh command line interface or read from input file list. |
integer |
Compare two list for their intersection. |
list |
Decode content of key file. |
list |
For given input file we find all parents in DB. |
tuple (oFileDict,oKeyDict,oLocDict) |
This routine generates location and key files from given list of intput sources (so far iFileList is a list of PDS files). |
string |
Generate key/location files names. |
string |
Generate a unique key/location file name. |
string (we use type of returning query) |
Lookup in FileID and either return fileID or 0 if file is not present. |
tuple |
Form a lists of runs, syncValues and proxies from given file. |
list @return list of graph id's |
Return a list of parent graph id's. |
list |
High-level function to retieve new set of unique ids. |
tuple |
Get list of parent pairs (id,fileName) for key/loc. |
long |
Get MAX fileId from master ESDB. |
list |
Allocate a new file id in FileID table. |
list |
Scan all files and return runUidList from them. |
integer |
Parse input file list and try to get version information from 'beginrun' stream according to specifications, please see https://wiki.lepp.cornell.edu/CleoSWIG/bin/view/Main/BeginrunVersioning The real job is done by pds_dump.decodeVersionInfo method. |
Open EventStore tables. | |
none |
Prints content of all EventStore table by using printDBContent |
none |
Prints content of EventStore based on its id. |
none |
Form a general report message with outline of current DB shapshot. |
list |
Retrieve file names and type ids from FileID table. |
tuple |
Read ASCII idxa file and return syncValue and runUid lists. |
none |
Send query to the master DB, the master DB may be specified by user, otherwise use EventStore@lnx151. |
none |
We may request data either from user or master DBs. |
none |
Set EventStore host name. |
none |
Set EventStore name. |
none |
Set EventStore port |
none |
Set EventStore socket |
none |
Set a flag to generate new database. |
none |
Set grade name |
none |
Set EventStore and host names of the underlying master ESDB. |
none |
Set upper bound on run range |
none |
Set lower bound on run range |
none |
Set no-skim flag, i.e. |
none |
Set location of output directory which would be used to write out key/location files |
none |
Set list of parents |
none |
Set file name which will be used to resolve data overlap conflicts |
none |
Set skim flag, i.e. |
none |
Set data version name |
none |
Set time stamp |
none |
Set view name |
Eliminates duplicates from provided list and return back unique list | |
integer |
Main method to update EventStore DB. |
integer |
Inject information from idxa file into EventStore. |
integer |
Inject sequentially files into EventStore. |
integer |
Inject provided files into EventStore as a logical group, e.g. |
none |
Update FileID table entry for given id, name and typeId. |
integer |
Update FileType table. |
none |
Update GraphPath table. |
none |
Update KeyFile table. |
none |
Update Location table. |
none |
Update PathDepend table. |
none |
Update RunID table. |
none |
Update SpecificVersion table. |
none |
Update Version table. |
Inherited from ESFileTypes | |
integer |
Check if given file type is allowed in EventStore. |
integer |
Check if given file type is allowed for injection in EventStore. |
list |
Return a list of known file types supported in EventStore. |
list |
Return a list of known file types supported in EventStore which allowed for injection. |
integer |
Check if given file type is data file. |
integer |
Check if given file type is index file. |
integer |
Check if given file type is location file. |
Inherited from SQLUtil | |
Close cursor and db connector | |
Explicit commit | |
Create table(s) in EventStore database. | |
Drop table in EventStore | |
Update EventStore db log and invoke COMMIT transaction. | |
Update a EventStore log and retrieve all rows for given query | |
Update a EventStore log and retrieve one row for given query | |
Find location of the data file holding given run | |
Get all parents for given child name | |
Get isolation level of SQLite DB | |
Get last autoincemented id for given table | |
Return a list of table names in EventStore DB | |
Return list of tables from DB | |
Return EventStore table schema | |
| |
Lock tables in EventStore. | |
Return the following dictionary: dict[time]=[(grade,minR,maxR,svName)] | |
Print content of given table in EventStore DB | |
Dump EventStore DB content in user readable format. | |
Print list of runs for given run range | |
Rollback transaction | |
Set flag which will inform underlying DB what to do with transaction commits. | |
Set isolation level for internal DB (necessary to perform SQLite transactions. | |
Set verbose level, 0 low, 1 is high. | |
Print all dependencies for given data version name. | |
Update EventStore db log and invoke BEGIN transaction. | |
Unlock all locked tables in EventStore | |
| |
Update EventStore log and execute given query. | |
Update EventStore db log with time/pid/msg signature |
Method Details |
---|
__init__(self,
db,
dbType,
logFile,
verbose=0)
Initialize database pointer, cursor, db type (MySQL or SQLite).
Retrieve information about table names from underlying DB.
|
allowStoreToDB(self, iFileList, checkFilesInDB=1)Check if we can add given files to DB, to be allowed they should contain non-overlaping data among themselves and with EventStore DB. This method also perform data integrity checks on input files. Please consult https://wiki.lepp.cornell.edu/CleoSWIG/bin/view/Main/EventStoreAdministration for more information.
|
checkFileList(self, fileList)Check if run/data from provided fileList are unique
|
checkParentsInDB(self)First thing during injection we need to check if provided list of parents is already present in DB, otherwise we need to inject parent's information.
|
checkVersionInfo(self, iFileList)Verify that versioning information either setup throguh command line interface or read from input file list.
|
compareLists(self, list1, list2)Compare two list for their intersection. If use python 2.4 we use 'set' intersection module, otherwise we count every entry from one list into another.
|
decodeKeyFile(self, keyFileName)Decode content of key file. It just invokeskey_dump.dump method.
|
findParents(self, iFile)For given input file we find all parents in DB. The fileType of parents should be the same as fileType of input file.
|
generateLocAndKeyFilesFrom(self, iFileList)This routine generates location and key files from given list of intput sources (so far iFileList is a list of PDS files). The input sources are analyzed and main ESDB or stand-alone DB is quiering for their parents. Please note that we search for parents of the same data type as input source. For example:
If parents are found (data files, key and location files) their key/loc. files can be used (instead input data files) for building output location and key files. Otherwise input data files are used. The common API uses 'readers' to walk through files. Currenly we implemented two types of readers, pds reader (see PDSFileReader) and key/loc. files reader (see KeyLocFilesReader class). The reader access data information and navigates through data. In order to build output key/loc. files we auto-probe the input sources. If parent's key file is found (and it's only one) its sync. values compared to input sync. values and if differ input sources are declared as a skim (input sources are subset of parents, e.g. DSkim). In the case of a skim we use its list of sync. values to drive the building process, otherwise parent's sync. list is used. In later case if input source doesn't have sync. value which is present in parent sync. values a fake entries are inserted into output location files. In this case the output key file is identical to parent one. In the case of skim, the output key file contains a subset of sync. values wrt parent one. To build output location header we combine proxies from parents and input sources if we're dealing with a skim case, e.g. DSkim injection. Otherwise we only use input source proxies, e.g. pass2 injection (no parents of the same data type are found) or post-pass2 injection (in this case parents are found (pass2), but sync. values of post-pass2 and pass2 are the same).
|
genFile(self, fileName, fileId, loc=0)Generate key/location files names. It uses genFileName to do a job.
|
genFileName(self, fileName, fileId, buildType)Generate a unique key/location file name. File name is formed by base of data file name, plus an unique file id assgined by FileID table during file id allocation.
|
getFileID(self, fileName)Lookup in FileID and either return fileID or 0 if file is not present. We usefetchOne method to make a query.
|
getFileInfo(self, iFile)Form a lists of runs, syncValues and proxies from given file.
|
getGraphIds(self, all='')Return a list of parent graph id's. Can perform nested lookup if all parameter is specified.
|
getIds(self, howMany)High-level function to retieve new set of unique ids. It uses getNextId to do a job.
|
getLocAndKeyFromParent(self, fileList)Get list of parent pairs (id,fileName) for key/loc. files from provided list of files.
|
getMaxId(self)Get MAX fileId from master ESDB. First we check MaxMasterID table for any recorded maxId. If it presents there we compare <db>@<host>:<port>:<socket> string to current one and raise exception if they're not match. If MaxMasterID is empty we retrieved information from master ESDB and record it to MaxMasterID.
|
getNextId(self, howMany)Allocate a new file id in FileID table. We rely on autoincrement feature of underlying DB.
|
getRunUidListFromFiles(self, fileList)Scan all files and return runUidList from them.
|
getVersionInfo(self, iFileList)Parse input file list and try to get version information from 'beginrun' stream according to specifications, please see https://wiki.lepp.cornell.edu/CleoSWIG/bin/view/Main/BeginrunVersioning The real job is done bypds_dump.decodeVersionInfo method.
|
openDBs(self)Open EventStore tables. If necessary usecreateTables routine to create those.
Everything is wrapped in transaction: startTxn and endTxn .
|
printAllDB(self)Prints content of all EventStore table by usingprintDBContent
|
printESDBContent(self, dbid)Prints content of EventStore based on its id.
|
printMsg(self, fileList, Message, level='ERROR')Form a general report message with outline of current DB shapshot.
|
queryFileIDTable(self, tup)Retrieve file names and type ids from FileID table.
|
readIDXAFile(self, fileName)Read ASCII idxa file and return syncValue and runUid lists.
|
requestDataFromDB(self, query, whatToRetrieve='all')Send query to the master DB, the master DB may be specified by user, otherwise use EventStore@lnx151.
|
requestDataFromUserDB(self, query, whatToRetrieve='all')We may request data either from user or master DBs. Return tuple for given query. |
setDBHost(self, dbHost)Set EventStore host name.
|
setDBName(self, dbName)Set EventStore name.
|
setDBPort(self, dbPort)Set EventStore port
|
setDBSocket(self, dbSocket)Set EventStore socket
|
setGenerateDB(self, newdb)Set a flag to generate new database.
|
setGrade(self, grade)Set grade name
|
setMasterDB(self, dbName, dbHost, dbPort='', dbSocket='')Set EventStore and host names of the underlying master ESDB. If toolkit is runnig in Cornell domain (lnx.cornell.edu) we use default lnx151.lns.cornell.edu as a master DB.
|
setMaxRun(self, maxR)Set upper bound on run range
|
setMinRun(self, minR)Set lower bound on run range
|
setNoSkimFlag(self, noskim)Set no-skim flag, i.e. inform ESManager to treat input sources as is
|
setOutputDir(self, oDir)Set location of output directory which would be used to write out key/location files
|
setParents(self, parents)Set list of parents
|
setReadDuplicatesSource(self, dupRead)Set file name which will be used to resolve data overlap conflicts
|
setSkimFlag(self, skim)Set skim flag, i.e. inform ESManager to treat input sources as a skim
|
setSVName(self, svName)Set data version name
|
setTimeStamp(self, timeS)Set time stamp
|
setView(self, view)Set view name
|
uniqueList(self, iList)Eliminates duplicates from provided list and return back unique list |
updateDB(self, genMode, iFileList, oHSMDir='')Main method to update EventStore DB. Based on provided file list it decide how to inject data into EventStore. Database is open by usingopenDBs , all input files are checked by
allowStoreToDB , then we update Version
table using updateVersion . Finally, based on file
type of input files we either use updateDBFromIDXA , updateDBUsingFileList or updateDBUsingGroupList to do actual
job.
|
updateDBFromIDXA(self, fileName)Inject information from idxa file into EventStore. In this case we only create a new index (key) file.
|
updateDBUsingFileList(self, generationMode, fileList, oHSMDir='')Inject sequentially files into EventStore. This method is used to inject raw data files to ESDB. Key and location files are generated by usingbuild_binary_key_loc.build_binKeyAndLoc
in case of binary input files or genFile . All tables in DB are updated by
using: updateKeyFile , updateRunUID and updateLocation .
|
updateDBUsingGroupList(self, fileList, oHSMDir='')Inject provided files into EventStore as a logical group, e.g. qcd_hot_runX, 2photon_hot_runX, etc. Key and location files are generated by usinggenerateLocAndKeyFilesFrom . All tables in
DB are updated by using: updateKeyFile , updateRunUID and updateLocation .
|
updateFileID(self, id, name, typeId)Update FileID table entry for given id, name and typeId. We usestartTxn and endTxn as transaction wrappers and updateDBAndLog for table update and
loging.
|
updateFileType(self, fileName)Update FileType table. File type is determined byfile_util.fileType . We use startTxn and endTxn as transaction wrappers and updateDBAndLog for table update and
loging.
|
updateGraphPath(self, graphid, svid)Update GraphPath table. We usestartTxn and endTxn as transaction wrappers and updateDBAndLog for table update and
loging.
|
updateKeyFile(self, graphid, view, run, uid, key_id)Update KeyFile table. We usestartTxn and endTxn as transaction wrappers and updateDBAndLog for table update and
loging.
|
updateLocation(self, graphid, run, uid, loc_id)Update Location table. We usestartTxn and endTxn as transaction wrappers and updateDBAndLog for table update and
loging.
|
updatePathDepend(self, svid)Update PathDepend table.
|
updateRunUID(self, run, uid)Update RunID table. We usestartTxn and endTxn as transaction wrappers and updateDBAndLog for table update and
loging.
|
updateSpecificVersion(self, svName, svid)Update SpecificVersion table. We usestartTxn and endTxn as transaction wrappers and updateDBAndLog for table update and
loging.
|
updateVersion(self)Update Version table. The procedure is to check if processed run fall in existing run range for given grade/timeStamp. Otherwise form new graphid, update GraphPath,SpecificVersion,PathDepend table(s)
|
Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Tue Jan 24 10:46:00 2006 | http://epydoc.sf.net |