From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Questions concerning "Simple Components" Date: Wed, 4 Nov 2015 10:09:33 +0100 Organization: cbb software GmbH Message-ID: <1v465ejy695lo$.47114uuwfga6$.dlg@40tude.net> References: <59c99dce-9cc6-4aba-9c5e-a5dd22ef7fea@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: TWQ9mg4k1m/sph/eQ+zHLA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:28208 Date: 2015-11-04T10:09:33+01:00 List-Id: On Tue, 3 Nov 2015 18:16:07 -0800 (PST), Jeremiah wrote: > Generic_B_Trees have a generic package parameter "Width" which has the > following description from the website: > "Width is the size of the bucket of key-value pairs allocated per tree node;" > > This doesn't make a lot of sense to me. I'm sure I am just missing > something simple, but what is the "bucket" being referenced? Is it > terminology for how many key value pairs can be created before more memory > has to be allocated? Yes > The "per tree node" part also throws me off a little > bit because on a binary tree, I would expect only one key/value pair per > node. Yes, in a logical view the container consists of key/value pairs. The physical view of it is a hierarchy of buckets having fixed size. > That said, I could be misunderstanding some of the terminology. > Can anyone add some clarity to what exactly the Width parameter does? Width is the number of pairs in the bucket. Depending on the tree (definite/indefinite) a bucket contains either the pairs as-is or references to the pairs allocated elsewhere. The persistent B-tree buckets have the size to fit into one block for optimal I/O. > I really like the concept of Generic_External_B_Tree which use persistent > storage to save data. One thing I am trying to get a better handle on is > a better way to handle the Root node address returned from > Get_Root_Address. I need this value to create the tree in a later > application invocation. I know I could just save it in another file or > possibly add a root address value to all my tree nodes, but both of those > methods seem wasteful. What methods do yall use to store the root node > address? The persistent memory pool the tree resides in has a root index reserved in particular for this purpose. The tree root address can be kept there. See: Get_Root_Index, Set_Root_Index. http://www.dmitry-kazakov.de/ada/components.htm#Persistent.Memory_Pools.Set_Root_Index There are 16 independent values you can store there. Note that the root address may change on tree update. After you have updated the tree before committing the pool, get the root address and store it into one of the root index values. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de