== SAFplus Management == === Overview == The SAFplus Management system provides an integrated NETCONF, SNMP, CLI (local and remote), local API, and web access platform whose data model presents to the northbound as a single management data configuration and statistics tree. Yet data can be stored and requests serviced by many separate applications running on many nodes in a cluster. Incoming requests from multiple protocol handlers are automatically translated into a standard high performance message request format and routed to the application that is currently servicing that portion of the data tree. Data routing is dynamic. Applications can "bind" to portions of the tree at any time, allowing data servicing to be handed from one application to another and for crashing applications to be seamlessly restarted or failed over. At the application layer, data is accessed via intuitive C++ "managed" objects. For example, a managed integer behaves The data model == Management Data Storage Architecture == 1. Why are some elements stored by index, others by name: /SAFplusAmf/Component[1]/instantiate VS. /SAFplusAmf/Node[@name="sc0"]/adminState How can you be sure you are looking it up properly? [Hoang] I did follow an xpath tool online http://xmltoolbox.appspot.com/xpath_generator.html, then follow up xpath result from SAFplusAmf.xml. Rule: If there is only one entry => xpath will have "key" as attribute value. Otherwise, index [1]...[n] if there are more than 2 entries. [Andrew] Your xpath is correct. But I don't understand how to choose between: . /SAFplusAmf/Node[@name="sc0"]/adminState and /SAFplusAmf/Node[1]/adminState Is that based on your described "rule". How can you tell if there is only one entry (I assume you mean child of an element). What if a new child is added? How do you choose Node[1] to be "sc0" and Node[2] to be "sc1"? (How do you assign indexes to the objects?) It would be simpler to only use a single xpath format: /SAFplusAmf/Node[@name=""]/... [Hoang] Yes, use [@name=""] is prefer and [index] is illegal but we support. We also did already at mgt properly. [Andrew] I propose that we only use @name= format to remove the ambiguity of having 2 different representations for the same data in the database. What are the problems with this? [Hoang] I fixed the issue. Now, unique building xpath: sg[@name="sg" ] 2. Why are you taking a key/value pair, generating a hash, and then storing 2 entries: hash->key hash->value [Hoang] I implement it to iterator keys faster by lookup at hash key of xpath. [Andrew] You mean iteration over all keys in the database? Why is lookup of a hash key faster? Why not just store the key value pair in one record? [Hoang] I based on DBAL abstract layer from 6.0 - it only support hash key and value for each binary DB. So, we can not extending to 3 columns hash "key | xpath | value" [Andrew] I mean why not have the database key be the xpath and the database value is the value. [Hoang] We did by this way: Database key (abc.idx) <==> hash key <==> Database value (abc.db) , does it confuse on using? [Andrew] I understand what you did, I'm asking WHY? [Hoang] I had just remember :). From hash->key table, we can "search" an xpath (key) and return a "similar" xpath(key) 3. At 0x16 bits of hash, there is a 1% chance of collision given 300 records. For a large model with 5000 records, there is a 94% chance of collision. What happens if there is a collision? [Hoang] You're right, I made a simple test and got ~200 collisions/5000 records. I will investigate to handle if collision - how about algorithm "Hashing with Double Hashing" - is it simplest? [Andrew] What is hashing with double hashing? Increasing the bit size to 32bits help dramatically, btw. We may need to consider 64 bit hashes though if we keep with the hashing idea. 4. dbalpy.py and pyDbal.cxx are clearly management specific since they store things using the 2 entry hash described above so should not be located in dbal OR called such a generic name. [Hoang] I will move these files to mgt at s7. 5. How does the system handle arbitrary data stored under an MGT node? What I mean is: if the programmer manually adds children under the MGT node, will this data be properly stored to the database? 6. How does it handle references to other MGT nodes? [Hoang] Can you provide an example? Actually, I never tried to run more than one instance of mgt on other node. [Andrew] I mean reference to other elements (nodes) in the MGT tree, not references to other physical nodes. The MGT on the other node will be an identical copy of the one here. For example, The Service Group contains a list of Service Units that are in that service group.