Star%20Database%20Tutorial - PowerPoint PPT Presentation

About This Presentation
Title:

Star%20Database%20Tutorial

Description:

Access by Query on predefined fields. Fast search over large ... updates (e.g. ~hourly snap-shot) ... does St_db_Maker know to load my. private test version of ... – PowerPoint PPT presentation

Number of Views:23
Avg rating:3.0/5.0
Slides: 29
Provided by: rjeffers
Learn more at: https://www4.rcf.bnl.gov
Category:

less

Transcript and Presenter's Notes

Title: Star%20Database%20Tutorial


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

2
(No Transcript)
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
(No Transcript)
6
(No Transcript)
7
(No Transcript)
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 (gtGbytes)

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
(No Transcript)
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-gtfetch(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-gtFind(specific-name)
  • gives St_A_Maker pointer to specific db data

16
DB Interface Model
  • StdbPtr mdbo factoryI-gtgetdbObject(name, time,
    version)

17
DB Interface Model issue
  • How does St_db_Maker know what to load?
  • 1) StdbCatalogI mycat factoryI-gtgetCatalog()
  • 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
  • ltNodegt Geometry
  • ltNodegt tpc
  • ltobjectgt TPCPadPlanes lt/objectgt
  • ltNodegt Sector_01
  • ltobjectgt sectorPosition
  • lt/objectgt lt/Nodegt
  • ltNodegt Sector_02
  • ltobjectgt sectorPositions ltversiongt V02
  • lt/versiongt lt/objectgt lt/Nodegt lt/Nodegt
  • lt/Nodegt
  • ObjyObjectName tpcSector_01sectorPositions

19
A Related Interface Issue
  • How does St_db_Maker know to load my
  • private test version of DB-data?
  • factoryI-gtprependSearchPath(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-gtFind(specific-name)
  • mdb_table (my_table) mdbds-gtGetTable()
  • 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-gtFind(specific-name)
  • mdbObj (DataObject )mdbds-gtGetdbObject()
  • 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 -gt transient -gt better
    transient
  • If DBInterface persistent -gt better transient

24
Basic Model
  • DB returns data Offl repacks into trans-DS
  • Case UI-Object gtdbStuctA dbStructB
  • StdbPtr mdbA factoryI-gtgetdbObject(A, time,
    version)
  • StdbPtr mdbB factoryI-gtgetdbObject(B, time,
    version) .
  • StDataObject mUI new StDataObject(mdbA, mdbB,
    .)
  • mDataSet-gtAddObject(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-gtgetdbObject(name,
    time,version)
  • mDataSet-gtAddObject(mUI)
  • DB ( Catalog) has to know about Data Objects
  • St_db_Maker does not.
  • In the end, it should be done somewhere AND
  • it shouldnt 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 havent 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.
Write a Comment
User Comments (0)
About PowerShow.com