11.01.2013 Views

Configuration Database CDB - 6th ACS Workshop at UTFSM 2009

Configuration Database CDB - 6th ACS Workshop at UTFSM 2009

Configuration Database CDB - 6th ACS Workshop at UTFSM 2009

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Configur<strong>at</strong>ion</strong><br />

<strong>D<strong>at</strong>abase</strong><br />

<strong>CDB</strong><br />

Bogdan Jeram<br />

(bjeram@eso.org)<br />

European Southern Observ<strong>at</strong>ory


ALMA Project<br />

<strong>CDB</strong>: the purpose<br />

• configuring of a system:<br />

– deployment info of the system (where, wh<strong>at</strong>)<br />

– <strong>Configur<strong>at</strong>ion</strong> for manager(s) and containers (how)<br />

– Component specific d<strong>at</strong>a - characteristic<br />

• each Component in the system might have (quasi)<br />

st<strong>at</strong>ic configur<strong>at</strong>ion parameters th<strong>at</strong> have to be<br />

configured in a persistent store and read when the<br />

Component is started up or re-initialized.<br />

• CharacteristicComponents MUST have<br />

configur<strong>at</strong>ion inform<strong>at</strong>ion in the <strong>CDB</strong><br />

Garching, January 2007 ALMA Common Software course<br />

2


ALMA Project<br />

Configurable deployment<br />

• “structure” of the system, i.e. which st<strong>at</strong>ically<br />

deployed Components are part of the system and<br />

their inter-rel<strong>at</strong>ionships.<br />

– looking <strong>at</strong> the <strong>CDB</strong> only, you should be able to see how<br />

the Components are distributed among the Containers<br />

and on wh<strong>at</strong> hosts the Containers are running.<br />

– Changing the <strong>CDB</strong> you can move Components around<br />

and distribute them in a different way in the system.<br />

• dynamic components can be partially deployed in<br />

the <strong>CDB</strong> – the missing info gets added <strong>at</strong> runtime.<br />

Garching, January 2007 ALMA Common Software course<br />

3


ALMA Project<br />

• XSD schemas<br />

<strong>CDB</strong> organiz<strong>at</strong>ion<br />

• current: XML files organized in directory<br />

hierarchy<br />

• future: TM<strong>CDB</strong><br />

Garching, January <strong>2009</strong> ALMA Common Software course<br />

4


ALMA Project<br />

• <strong>CDB</strong> (root)<br />

D<strong>at</strong>a organiz<strong>at</strong>ion<br />

(directory hierarchy)<br />

– MACI (system deployment d<strong>at</strong>a)<br />

• Managers<br />

• Containers<br />

• Components (just component deployment d<strong>at</strong>a)<br />

• Channels<br />

– alma (characteristic component specific d<strong>at</strong>a)<br />

– alarm (optional for alarms)<br />

Garching, January 2007 ALMA Common Software course<br />

5


<strong>CDB</strong><br />

ALMA Project<br />

<strong>CDB</strong>/MACI structure<br />

MACI Managers<br />

alma<br />

schemas<br />

Components<br />

Garching, January 2007 ALMA Common Software course<br />

Manager<br />

Containers myCont1<br />

myComp<br />

yourComp<br />

anotherComp<br />

yourCont<br />

6


ALMA Project<br />

Structure of Components<br />

deployment d<strong>at</strong>a (Components.xsd)<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Garching, January 2007 ALMA Common Software course<br />

7


ALMA Project<br />

Loc<strong>at</strong>ion of components deployment<br />

info (Components.xml)<br />

• $<strong>ACS</strong>_<strong>CDB</strong><br />

• <strong>CDB</strong>/MACI/Components/Components.xml<br />

Garching, January 2007 ALMA Common Software course<br />

8


ALMA Project<br />

MACI/Components/Components.xml<br />

List of component instances<br />

<br />


ALMA Project<br />

Altern<strong>at</strong>ives to a single large<br />

Components.xml file<br />

• Several such files (same structure each) can be included in the master file<br />

Components.xml using an XML include mechanism as in<br />


ALMA Project<br />

Structure of Manager d<strong>at</strong>a<br />

(Manager.xsd)<br />

<br />

<br />

<br />


ALMA Project<br />

• $<strong>ACS</strong>_<strong>CDB</strong><br />

Manager instance file loc<strong>at</strong>ion<br />

• <strong>CDB</strong>/MACI/Managers/Manager/Manager.xml<br />

Garching, January 2007 ALMA Common Software course<br />

12


ALMA Project<br />

Manager instance example<br />

(Manager.xml)<br />


ALMA Project<br />

Structure of Container d<strong>at</strong>a<br />

(Container.xsd)<br />

DALtype<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Garching, January 2007 ALMA Common Software course<br />

14


ALMA Project<br />

• $<strong>ACS</strong>_<strong>CDB</strong><br />

Container instance file loc<strong>at</strong>ion<br />

• <strong>CDB</strong>/MACI/Containers/<br />

/.xml<br />

• Example:<br />

<strong>CDB</strong>/MACI/Containers/myContainer/myCo<br />

ntainer.xml<br />

Garching, January 2007 ALMA Common Software course<br />

15


ALMA Project<br />

Container Instance<br />

(XML file)<br />


Loading Steps<br />

ALMA Project<br />

Client<br />

Manager<br />

Manager.xml<br />

Components.xml<br />

Container(C++)<br />

“bilboContainer”<br />

Manager.xml bilboContainer.xml<br />

Garching, January 2007 ALMA Common Software course<br />

X<br />

Container(java)<br />

“frodoContainer”<br />

Y frodoContainer.xml<br />

17


ALMA Project<br />

parent directory<br />

File1.xml<br />

<strong>CDB</strong> D<strong>at</strong>a Retrieval<br />

XML d<strong>at</strong>a mapped to D<strong>at</strong>a Access Objects (DAOs)<br />

FILES NODES<br />

child directory1<br />

File2.xml<br />

child directory2<br />

File3.xml<br />

File4.xml<br />

<strong>CDB</strong> D<strong>at</strong>a Access<br />

Layer (DAL) Server<br />

get “parent”<br />

DAO<br />

“File1”,<br />

“File2”,<br />

“File3”,<br />

“File4”<br />

Garching, January 2007 ALMA Common Software course<br />

Client (Container<br />

or Component)<br />

get “parent/child1”<br />

DAO<br />

“File2”<br />

18


Remote<br />

object<br />

for d<strong>at</strong>a<br />

field<br />

retrieval<br />

ALMA Project<br />

DAL server implements DAL IDL:<br />

DAL Server<br />

interface DAL {<br />

string get_DAO( in string curl )<br />

raises (RecordDoesNotExist,XMLerror);<br />

};<br />

DAO get_DAO_Servant( in string curl )<br />

XML string for<br />

local processing<br />

raises (RecordDoesNotExist,XMLerror);<br />

oneway void shutdown();<br />

//d<strong>at</strong>a change handling<br />

long add_change_listener( in DALChangeListener listener );<br />

void listen_for_changes( in string curl, in long listenerID );<br />

void remove_change_listener( in long listenerID );<br />

// listing<br />

string list_nodes( in string name );<br />

Garching, January 2007 ALMA Common Software course<br />

19


ALMA Project<br />

DAO IDL<br />

interface DAO {<br />

long get_long( in string propertyName )<br />

raises (WrongD<strong>at</strong>aType, FieldDoesNotExist);<br />

double get_double( in string propertyName )<br />

raises (WrongD<strong>at</strong>aType, FieldDoesNotExist);<br />

string get_string( in string propertyName )<br />

};<br />

raises (WrongD<strong>at</strong>aType, FieldDoesNotExist);<br />

string get_field_d<strong>at</strong>a( in string propertyName )<br />

raises (WrongD<strong>at</strong>aType, FieldDoesNotExist);<br />

stringSeq get_string_seq( in string propertyName )<br />

raises (WrongD<strong>at</strong>aType, FieldDoesNotExist);<br />

longSeq get_long_seq( in string propertyName )<br />

raises (WrongD<strong>at</strong>aType, FieldDoesNotExist);<br />

doubleSeq get_double_seq( in string propertyName)<br />

raises (WrongD<strong>at</strong>aType, FieldDoesNotExist);<br />

Garching, January 2007 ALMA Common Software course<br />

20


ALMA Project<br />

Component retrieves d<strong>at</strong>a from<br />

C++<br />

MyComponent::mymethod(….)<br />

{<br />

try {<br />

<strong>CDB</strong>::DAL_ptr dal_p = getContainerServices()->get<strong>CDB</strong>();<br />

<strong>CDB</strong>::DAO_ptr dao_p = dal_p->get_DAO_Servant(curl);<br />

description = dao_p->get_string( "description" );<br />

m_units = dao_p->get_string( "units" );<br />

m_min_step = dao_p->get_double( "minStep" );<br />

}<br />

c<strong>at</strong>ch( <strong>ACS</strong>ERR::<strong>ACS</strong>baseExImpl &ex ) {<br />

ReportError( m_name, "Unable to read configur<strong>at</strong>ion!"<br />

);<br />

return false;<br />

}<br />

}<br />

Garching, January 2007 ALMA Common Software course<br />

21


ALMA Project<br />

DAL navig<strong>at</strong>ion interface<br />

• Retrieve the list of all children of the given node to allow<br />

navig<strong>at</strong>ion of the <strong>CDB</strong> hierarchical structure:<br />

interface DAL {<br />

};<br />

string list_nodes( in string name );<br />

• This allows an applic<strong>at</strong>ion to discover the <strong>CDB</strong> structure.<br />

Is essential to build a <strong>CDB</strong> generic browser<br />

Garching, January 2007 ALMA Common Software course<br />

22


ALMA Project<br />

Default <strong>CDB</strong><br />

• jDAL (Java implement<strong>at</strong>ion of <strong>CDB</strong>)<br />

started as part of acsStartORBSRVC<br />

• $<strong>ACS</strong>_<strong>CDB</strong> points to <strong>CDB</strong> entry point<br />

• Default file loc<strong>at</strong>ion:<br />

$<strong>ACS</strong>DATA/config/default<strong>CDB</strong><br />

• Test configur<strong>at</strong>ion d<strong>at</strong>a:<br />

test/<strong>CDB</strong><br />

Garching, January 2007 ALMA Common Software course<br />

23


ALMA Project<br />

<strong>CDB</strong> Browser<br />

Garching, January 2007 ALMA Common Software course<br />

24

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!