Presentation is loading. Please wait.

Presentation is loading. Please wait.

Star Database Tutorial Package Design & Objectivity Discussion Interface Questions – What do you want? -> making requests – What do you get? -> data container.

Similar presentations


Presentation on theme: "Star Database Tutorial Package Design & Objectivity Discussion Interface Questions – What do you want? -> making requests – What do you get? -> data container."— 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

3 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

4 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

5

6

7

8 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)

9 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”

10

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

12 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

13 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

14 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

15 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

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

17 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”.

18 DB Catalog Structure Geometry tpc TPCPadPlanes Sector_01 sectorPosition Sector_02 sectorPositions V02 ObjyObjectName = tpcSector_01sectorPositions

19 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.

20 2) What do you get?

21 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*.

22 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

23 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

24 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.

25 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.

26 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 )

27 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.

28 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.


Download ppt "Star Database Tutorial Package Design & Objectivity Discussion Interface Questions – What do you want? -> making requests – What do you get? -> data container."

Similar presentations


Ads by Google