[Brahms-dev-l] new brat version (2.22.1)

From: Kris Hagel <hagel@comp.tamu.edu>
Date: Mon Jul 19 2004 - 11:25:57 EDT
Hello,
This is to announce a new brat version, 2.22.1.  I implemented our 
standard DB access to the file catalog that Hiro developed and 
announced.  The file catalog DB access is more or less modeled on the 
run DB access.

If you look at the details, you will notice that the file catalog access 
follows what Hiro did for the BrIOModule::AddFileSet(...).  I have not 
changed the AddFileSet from the raw sql queries to use this access 
because I want to exercise the software first to make sure there are no 
nasty surprises.

 I would say as a general rule, however, that we should be careful in 
allowing raw SQL queries to sneak into our code.  The philosophy which 
has served us very well is to have the raw SQL queries abstracted by our 
standard DB access.  We have made a big investment in developing this 
consistent Database access and if we start adding raw SQL code at 
"random" places we will have a mess that will be hard/impossible to 
clean when the smallest change or maintenance is necessary.

I realized that required some effort, so I put my effort where my mouth 
was and generated this DB access inside our DB framework.  There is 
still work to do and discussion regarding details to be had, but 90% of 
the work is done.

File catalog information: 

Here are the instructions for the general Joe Sixpak brat user to use 
this new software.  The user mode of access is through 
BrFileCatalogManager and BrFileCatalogInfo.
1. DB connection
Connect to the maindb in the usual way.  Then:
BrFileCatalogsDb *fileCatalogDb = mainDb->ConnectToFileCatalog("query");
if(!fileCatalogDb->Connect()) cerr<<"Can't connect to file catalog"<<endl;

2. Register runs in the same way as the run db, only with appropriate 
arguments
BrFileCatalogManager *fileCatalog = BrFileCatalogManager::Instance();
fileCatalog->Register(11800,"gtr",1);   //eg
fileCatalog->Register(11880,"gtr",1);   //eg
fileCatalog->Init();

Then use fileCatalog->Update() to get back the different runs.
In addition if you want a run that is not registered, you can do
fileCatalog->Update(11800,"gtr,1);  //eg

To get the information, after doing the update, you would do
BrFileCatalogInfo *info = fileCatalog->GetCurrentRun();
There are access methods for the different production information.  For 
example to get the root version, use info->GetRootVersion(), or for brat 
ver use info->GetBratVersion()

If you want to find the information for the different sequences (ie 
their location), you would use info->NextSequence() followed by 
info->GetCurrentFile();

For the record, I also added the energy, specie and run period to the 
run db access to reflect the new fields in the run db.  The file catalog 
uses these as well.

Enjoy.

Kris



_______________________________________________
Brahms-dev-l mailing list
Brahms-dev-l@lists.bnl.gov
http://lists.bnl.gov/mailman/listinfo/brahms-dev-l
Received on Mon Jul 19 11:26:24 2004

This archive was generated by hypermail 2.1.8 : Mon Jul 19 2004 - 11:26:51 EDT