1 / 28

Star Database Tutorial

Star Database Tutorial. Package Design & Objectivity Discussion Interface Questions What do you want? -> making requests What do you get? -> data container How to add a new object type? -> definition protocols How do you update? -> db input protocols. Objectivity: OODB w/ C++ API.

ananda
Download Presentation

Star Database Tutorial

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Star Database Tutorial • Package Design & Objectivity Discussion • Interface Questions • What do you want? -> making requests • What do you get? -> data container • How to add a new object type? -> definition protocols • How do you update? -> db input protocols

  2. Objectivity: OODB w/ C++ API • Is a Database • Persistency Mechanism • Concurrency & Locking Mechanisms • Access by Query on predefined fields • Fast search over large data samples

  3. Objectivity: OODB w/ C++ API • Is an OO Database • Provides Direct Navigation tools to data • Gives OO methodology to persistent data • But … • Direct Navigation was attractive for Event-Store • Persistent-to-Transient copy allows adding OO methodology at copy level

  4. Conditions DB Description Database of the experimental conditions. Database Access • Updates are predominantly done from Online • Storage & retrieval by timestamp Update Frequency • pre-determined updates (e.g. ~hourly snap-shot) • alarm-activated updates (at level of individual object) Data Volume • moderate per update (~Mbyte) • moderately large in aggregate (>~Gbytes)

  5. Star-BaBar Conditions DB Is applied to each Subsystem(e.g. tpc, svt, ..) conditions/subsystem/UniqueObjects conditions/subsystem/Index-to-Objects e.g. TPCVoltages & Sector_01Voltages represent unique (& uniquely named) object types stored in the “conditions/tpc/databases” & accessed via “conditions/tpc/IndexDB”

  6. Conditions-like Star DBs Access by time-stamp & subsystem conditions/subsystem configurations/subsystem calibrations/subsystem geometry/subsystem

  7. Interface Questions • What do you want? - making requests • What do you get? - data container • How to add new object type? - definition protocols • How do you update? - db input protocols

  8. 1) What do you want? Offline data is organized in Tree-Structure good idea - Online likes this too. Database-API Tree is shallow (2-levels) map to Tree structure at data access Database access is request & retrieve process BdbDatabase->fetch(ObjH,indexContainer,theTime); Codes need to know what to request at object level

  9. Current Offline Model Objects are files in Tree-like file-system file-system = catalog of available objects $STAR/StDb/params/tpc/trspar/Trs.C A time-stamp in the filename for each instance myobject.time.C or myobject.time.xdf Upon request, all valid data in Tree is loaded other Makers get data from memory resident Tree

  10. Offline Interface Model St_DataSet* ds = GetDataBase(subtree-name); • loads Tree-structure under “subtree-name” into db memory mdbds = ds->Find(specific-name); • gives St_A_Maker pointer to specific db data

  11. DB Interface Model StdbPtr* mdbo = factoryI->getdbObject(name, time, version);

  12. DB Interface Model issue How does St_db_Maker know what to load? 1) StdbCatalogI* mycat = factoryI->getCatalog(); Catalog is Tree-Structured container of all available objects for this dbType. 2) StdbCatalogI* mycat = new StdbCatalog(“file”); “file” contains Tree-Structured container of objects as filtered for a specific “Chain”.

  13. DB Catalog Structure <Node> Geometry <Node> tpc <object> TPCPadPlanes </object> <Node> Sector_01 <object> sectorPosition </object> </Node> <Node> Sector_02 <object> sectorPositions <version> V02 </version> </object> </Node> </Node> </Node> ObjyObjectName = tpcSector_01sectorPositions

  14. A Related Interface Issue How does St_db_Maker know to load my private test version of DB-data? factoryI->prependSearchPath(“pathname”); 1) Factory will use your path 1st to access db-data. 2) Data must be in “the standard” format & Tree 3) St_db_Maker needs to call this function; Not You.

  15. 2) What do you get?

  16. DB Return-type: StdbPtr • Transient DB objects inherit from StdbPtr. • StdbPtr contains a (list of) pointer to StdbObjectI. • StdbObjectI defines methods: getName(), getVersion(), getEndTime(), ... • StdbPtr uses StdbObjectI to provide method : bool isValid(time,version); • St_DbSet (like St_ObjectSet) inherits from St_DataSet & contains StdbPtr*.

  17. What does this mean to you? Remember, we had St_DataSet* ds = GetDataBase(subtree-name); • loads Tree-structure under “subtree-name” into db memory mdbds = ds->Find(specific-name); mdb_table = (my_table*) mdbds->GetTable(); • gives St_A_Maker pointer to specific db data Now we have, St_DataSet* ds = GetDataBase(subtree-name); • loads Tree-structure under “subtree-name” into db memory mdbds = ds->Find(specific-name); mdbObj = (DataObject *)mdbds->GetdbObject(); • gives St_A_Maker pointer to specific db data

  18. Transient-Persistent Mismatch Efficient data storage suggests grouping data by function & update frequency. This organization can be different than what user codes want. Who does copying from persistent structure to desirable transient structure? If Offline: persistent -> transient -> better transient If DBInterface: persistent -> better transient

  19. Basic Model DB returns data; Offl repacks into trans-DS : Case: UI-Object =>dbStuctA + dbStructB + … StdbPtr* mdbA = factoryI->getdbObject(“A”, time, version); StdbPtr* mdbB = factoryI->getdbObject(“B”, time, version); …. StDataObject* mUI = new StDataObject(mdbA, mdbB, ….); mDataSet->AddObject(mUI); if(mdbA) delete mdbA; if(mdbB) delete mdbB; …. St_db_Maker has to know about Data Objects DB does not.

  20. Alternative Model (“in use”) DB returns filled UI-Object as requested StdbPtr* mUI = factoryI->getdbObject(name, time,version); mDataSet->AddObject(mUI); DB (& Catalog) has to know about Data Objects St_db_Maker does not. In the end, it should be done somewhere AND it shouldn’t matter to user codes.

  21. 3) How to add a new data type? Join starcalib-l & meetings The process is not Templated yet…. Also look at some current examples $STAR_DB/DataBases/preStDb/Calib/... $STAR/StDb/params/… ($STAR_DB is not on AFS but on rcf )

  22. in particular ... Work with calib/database group to add to Database. Define the data members needed typically one or more c-structs Define the UI object that is needed may be a simple table… may be more complex Define a class that implements UI & contains the data.

  23. 4) How to update db-data? Protocols haven’t been defined. There will be some access restrictions on updates like Online authorization modes or CVS Private output via ROOT or XDF files + migration step into the Database is a likely general solution.

More Related