directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r879404 - in /websites/staging/directory/trunk/content: ./ mavibot/user-guide/2.1-file-format.html mavibot/user-guide/2.1-logical-structure.html mavibot/user-guide/2.2-physical-storage.html
Date Sun, 22 Sep 2013 05:03:02 GMT
Author: buildbot
Date: Sun Sep 22 05:03:02 2013
New Revision: 879404

Log:
Staging update by buildbot for directory

Added:
    websites/staging/directory/trunk/content/mavibot/user-guide/2.1-logical-structure.html
    websites/staging/directory/trunk/content/mavibot/user-guide/2.2-physical-storage.html
Removed:
    websites/staging/directory/trunk/content/mavibot/user-guide/2.1-file-format.html
Modified:
    websites/staging/directory/trunk/content/   (props changed)

Propchange: websites/staging/directory/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Sun Sep 22 05:03:02 2013
@@ -1 +1 @@
-1525247
+1525320

Added: websites/staging/directory/trunk/content/mavibot/user-guide/2.1-logical-structure.html
==============================================================================
--- websites/staging/directory/trunk/content/mavibot/user-guide/2.1-logical-structure.html
(added)
+++ websites/staging/directory/trunk/content/mavibot/user-guide/2.1-logical-structure.html
Sun Sep 22 05:03:02 2013
@@ -0,0 +1,194 @@
+<!DOCTYPE html>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<html>
+	<head>
+		<title>2.1 - Logical Structure &mdash; Apache Directory</title>
+		
+	    <link href="./../../css/common.css" rel="stylesheet" type="text/css">
+	    <link href="./../../css/turquoise.css" rel="stylesheet" type="text/css">
+    
+        
+        <link rel="shortcut icon" href="./../../images/mavibot-icon_16x16.png">
+    
+        <!-- Google Analytics -->
+        <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
+        <script type="text/javascript">
+            _uacct = "UA-1358462-1";
+            urchinTracker();
+        </script>
+	</head>
+	<body>
+	    <div id="container">
+            <div id="header">
+                <div id="subProjectsNavBar">
+                    <a href="./../../">
+                        
+                        Apache Directory Project
+                        
+                    </a>
+                    &nbsp;|&nbsp;
+                    <a href="./../../apacheds">
+                        
+                        ApacheDS
+                        
+                    </a>
+                    &nbsp;|&nbsp;
+                    <a href="./../../studio">
+                        
+                        Apache Directory Studio
+                        
+                    </a>
+                    &nbsp;|&nbsp;
+                    <a href="./../../api">
+                        
+                        Apache LDAP API
+                        
+                    </a>
+                    &nbsp;|&nbsp;
+                    <a href="./../../mavibot">
+                        
+                        <STRONG>Mavibot</STRONG>
+                        
+                    </a>
+                </div><!-- subProjectsNavBar -->
+            </div><!-- header -->
+            <div id="content">
+                <div id="leftColumn">
+                    
+<div id="navigation">
+    
+    <h5>Mavibot 1.0</h5>
+    <ul>
+        <li><a href="./../../mavibot/">Home</a></li>
+        <li><a href="./../../mavibot/news.html">News</a></li>
+    </ul>
+    <h5>Downloads</h5>
+    <ul>
+	    <li><a href="./../../mavibot/downloads.html">Version 1.0.0-M1</a>&nbsp;&nbsp;<IMG
src="./../../images/new_badge.gif" alt="" style="margin-bottom:-3px;" border="0"></li>
+        <li><a href="./../../mavibot/download-old-versions.html">Older versions</a></li>
+    </ul>
+    <h5>Getting Started</h5>
+    <ul>
+        <li><a href="./../../mavibot/vision.html">Vision</a></li>
+    </ul>
+    <h5>Documentation</h5>
+    <ul>
+        <li><a href="./../../mavibot/five-minutes-tutorial.html">Five minutes
tutorial</a></li>
+	<li><a href="./../../mavibot/user-guide.html">User Guide</a></li>
+        <li><a href="./../../mavibot/gen-docs/latest/apidocs/">JavaDocs</a></li>
+        <!--li><a href="./../../mavibot/gen-docs/latest/">Generated Reports</a></li-->
+        <li><a href="./../../mavibot/developer-guide.html">Developer Guide</a></li>
+    </ul>
+    
+    
+    <h5>Support</h5>
+    <ul>
+        <li><a href="./../../mailing-lists-and-irc.html">Mailing Lists &amp;
IRC</a></li>
+        <li><a href="./../../sources.html">Sources</a></li>
+        <li><a href="./../../issue-tracking.html">Issue Tracking</a></li>
+        <li><a href="./../../commercial-support.html">Commercial Support</a></li>
+    </ul>
+    <h5>Community</h5>
+    <ul>
+        <li><a href="./../../contribute.html">How to Contribute</a></li>
+        <li><a href="./../../team.html">Team</a></li>
+        <li><a href="./../../original-project-proposal.html">Original Project
Proposal</a></li>
+        <li><a href="./../../special-thanks.html" class="external-link" rel="nofollow">Special
Thanks</a></li>
+    </ul>
+    <h5>About Apache</h5>
+    <ul>
+        <li><a href="http://www.apache.org/">Apache</a></li>
+        <li><a href="http://www.apache.org/licenses/">License</a></li>
+        <li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li>
+        <li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+        <li><a href="http://www.apache.org/security/">Security</a></li>
+    </ul>
+    <a href="http://ldapcon.org" target="_blank" rel="nofollow"><img src="./../../images/banner-ldapcon-2013.png"
alt="LDAPCon 2013" width="167" height="231"></a>
+    
+</div><!-- navigation -->
+
+                </div><!-- leftColumn -->
+                <div id="rightColumn">
+
+
+    <div class="nav">
+        <div class="nav_prev">
+        
+			&nbsp;
+        
+        </div>
+        <div class="nav_up">
+        
+            <a href="../user-guide.html">User Guide</a>
+		
+        </div>
+        <div class="nav_next">
+        
+            <a href="2.2-physical-storage.html">2.2 - Physical storage</a>
+		
+        </div>
+        <div class="clearfix"></div>
+    </div>
+
+
+<h1 id="21-logical-structure">2.1 - Logical Structure</h1>
+<h2 id="special-btrees">Special BTrees</h2>
+<p>We have two special <em>BTree</em>s we use to manage the revisions and
the copied pages. We will explain what they are good for</p>
+<h3 id="revision-tree">Revision tree</h3>
+<p>We need to keep a track of each active revision, so that a search can work with
a specific revision. The idea is that when a search starts, it uses the latest revision, but
as some modification can occur while teh search is bieng processed, some new revisions will
be added. In some case, we may want to keep a revision active for quite a long time.</p>
+<p>So we store the active revisions in a dedicated <em>BTree</em>.</p>
+<p>As we may have many <em>BTree</em>s, we have to use a key which is a
combinaison of the <em>BTree</em> name and its revision. So the revision <em>BTree</em>
manage the revisions of all the managed <em>BTree</em>s.</p>
+<p>When a revision is not anymore used, we can remove it from the revision <em>BTree</em>.</p>
+<p>This <em>BTree</em> is not a <strong>MVCC</strong> <em>BTree</em>,
like the other ones. In other words, we only keep the latest revision of this <em>BTree</em>
(ie, all the modified pages are immediately freed)</p>
+<h3 id="copied-pages-btree">Copied pages BTree</h3>
+<p>Once we create a new revision, the pages we copied are not anymore in use except
if the revisions they are associated with are still in use. The problem is that we can't discard
those pages and move them to the free list until the associated revision is free.</p>
+<p>We use a dedicated <em>BTree</em> to keep a track of the copied pages,
which will be reclaimed and moved to the free pages list once the associated revision will
be released.</p>
+<h2 id="managing-the-free-pages">Managing the free pages</h2>
+<p>We have a mechanism to manage the <em>PageIO</em> that are not anymore
in use. This is a linked list in which the free pages are added. If we need some page, we
first look into this list, and get back as many <em>PageIO</em>s as we need -
until we reach the end of this list. If we free some page, we add them at the end of the free
list.</p>
+<p>We always free a logical page, which may be stored into many <em>PageIO</em>s.
The good thing is that those <em>PageIO</em>s are already linked, so we just need
to make the last free <em>PageIO</em> to point on the first freed <em>PageIO</em>,
and to move the pointer to the last free page to the last <em>PageIO</em> used
to store the logical page.</p>
+
+
+    <div class="nav">
+        <div class="nav_prev">
+        
+			&nbsp;
+        
+        </div>
+        <div class="nav_up">
+        
+            <a href="../user-guide.html">User Guide</a>
+		
+        </div>
+        <div class="nav_next">
+        
+            <a href="2.2-physical-storage.html">2.2 - Physical storage</a>
+		
+        </div>
+        <div class="clearfix"></div>
+    </div>
+
+
+                </div><!-- rightColumn -->
+                <div id="endContent"></div>
+            </div><!-- content -->
+            <div id="footer">&copy; 2003-2012, <a href="http://www.apache.org">The
Apache Software Foundation</a> - <a href="./../../privacy-policy.html">Privacy
Policy</a><br />
+                Apache Directory, ApacheDS, Apache Directory Server, Apache Directory Studio,
Apache LDAP API, Apache Triplesec, Triplesec, Apache Mavibot, Mavibot, Apache, the Apache
feather logo, and the Apache Directory project logos are trademarks of The Apache Software
Foundation.
+            </div>
+        </div><!-- container -->
+    </body>
+</html>

Added: websites/staging/directory/trunk/content/mavibot/user-guide/2.2-physical-storage.html
==============================================================================
--- websites/staging/directory/trunk/content/mavibot/user-guide/2.2-physical-storage.html
(added)
+++ websites/staging/directory/trunk/content/mavibot/user-guide/2.2-physical-storage.html
Sun Sep 22 05:03:02 2013
@@ -0,0 +1,259 @@
+<!DOCTYPE html>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<html>
+	<head>
+		<title>2.2 - Physical storage &mdash; Apache Directory</title>
+		
+	    <link href="./../../css/common.css" rel="stylesheet" type="text/css">
+	    <link href="./../../css/turquoise.css" rel="stylesheet" type="text/css">
+    
+        
+        <link rel="shortcut icon" href="./../../images/mavibot-icon_16x16.png">
+    
+        <!-- Google Analytics -->
+        <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
+        <script type="text/javascript">
+            _uacct = "UA-1358462-1";
+            urchinTracker();
+        </script>
+	</head>
+	<body>
+	    <div id="container">
+            <div id="header">
+                <div id="subProjectsNavBar">
+                    <a href="./../../">
+                        
+                        Apache Directory Project
+                        
+                    </a>
+                    &nbsp;|&nbsp;
+                    <a href="./../../apacheds">
+                        
+                        ApacheDS
+                        
+                    </a>
+                    &nbsp;|&nbsp;
+                    <a href="./../../studio">
+                        
+                        Apache Directory Studio
+                        
+                    </a>
+                    &nbsp;|&nbsp;
+                    <a href="./../../api">
+                        
+                        Apache LDAP API
+                        
+                    </a>
+                    &nbsp;|&nbsp;
+                    <a href="./../../mavibot">
+                        
+                        <STRONG>Mavibot</STRONG>
+                        
+                    </a>
+                </div><!-- subProjectsNavBar -->
+            </div><!-- header -->
+            <div id="content">
+                <div id="leftColumn">
+                    
+<div id="navigation">
+    
+    <h5>Mavibot 1.0</h5>
+    <ul>
+        <li><a href="./../../mavibot/">Home</a></li>
+        <li><a href="./../../mavibot/news.html">News</a></li>
+    </ul>
+    <h5>Downloads</h5>
+    <ul>
+	    <li><a href="./../../mavibot/downloads.html">Version 1.0.0-M1</a>&nbsp;&nbsp;<IMG
src="./../../images/new_badge.gif" alt="" style="margin-bottom:-3px;" border="0"></li>
+        <li><a href="./../../mavibot/download-old-versions.html">Older versions</a></li>
+    </ul>
+    <h5>Getting Started</h5>
+    <ul>
+        <li><a href="./../../mavibot/vision.html">Vision</a></li>
+    </ul>
+    <h5>Documentation</h5>
+    <ul>
+        <li><a href="./../../mavibot/five-minutes-tutorial.html">Five minutes
tutorial</a></li>
+	<li><a href="./../../mavibot/user-guide.html">User Guide</a></li>
+        <li><a href="./../../mavibot/gen-docs/latest/apidocs/">JavaDocs</a></li>
+        <!--li><a href="./../../mavibot/gen-docs/latest/">Generated Reports</a></li-->
+        <li><a href="./../../mavibot/developer-guide.html">Developer Guide</a></li>
+    </ul>
+    
+    
+    <h5>Support</h5>
+    <ul>
+        <li><a href="./../../mailing-lists-and-irc.html">Mailing Lists &amp;
IRC</a></li>
+        <li><a href="./../../sources.html">Sources</a></li>
+        <li><a href="./../../issue-tracking.html">Issue Tracking</a></li>
+        <li><a href="./../../commercial-support.html">Commercial Support</a></li>
+    </ul>
+    <h5>Community</h5>
+    <ul>
+        <li><a href="./../../contribute.html">How to Contribute</a></li>
+        <li><a href="./../../team.html">Team</a></li>
+        <li><a href="./../../original-project-proposal.html">Original Project
Proposal</a></li>
+        <li><a href="./../../special-thanks.html" class="external-link" rel="nofollow">Special
Thanks</a></li>
+    </ul>
+    <h5>About Apache</h5>
+    <ul>
+        <li><a href="http://www.apache.org/">Apache</a></li>
+        <li><a href="http://www.apache.org/licenses/">License</a></li>
+        <li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li>
+        <li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+        <li><a href="http://www.apache.org/security/">Security</a></li>
+    </ul>
+    <a href="http://ldapcon.org" target="_blank" rel="nofollow"><img src="./../../images/banner-ldapcon-2013.png"
alt="LDAPCon 2013" width="167" height="231"></a>
+    
+</div><!-- navigation -->
+
+                </div><!-- leftColumn -->
+                <div id="rightColumn">
+
+
+    <div class="nav">
+        <div class="nav_prev">
+        
+            <a href="2.1-logical-structure.html">2.1 - Logical Structure</a>
+		
+        </div>
+        <div class="nav_up">
+        
+            <a href="../user-guide.html">User Guide</a>
+		
+        </div>
+        <div class="nav_next">
+        
+            <a href="2-.html">2 - </a>
+		
+        </div>
+        <div class="clearfix"></div>
+    </div>
+
+
+<h1 id="22-physical-storage">2.2 - Physical storage</h1>
+<p>When associated with a RecordManager, Mavibot stores all the Btrees in one single
file, which is split in many physical pages, all having the same size. </p>
+<blockquote>
+<p><strong>Note</strong>
+Currently, the choice was to use one single size for all the pages, regardless the data we
store into them. The rationnal is to
+get close to the OS page size (frequently 512 bytes or 4096 bytes). This is not necessarily
the best choice though, let's say 
+it's something we might want to change later.</p>
+</blockquote>
+<h2 id="general-file-structure">General file structure</h2>
+<p>The file we use to store the data is a plain binary file, used to store all the
BTrees. We can store many btrees in one single file.</p>
+<p>This file is considered as a fileSystem, with fixed size 'pages' (a page is an array
of bytes). The page size is arbitrary fixed when teh RecordManager is created, and we will
store every logical data n those physical pages, which will require to spread the logical
data in many pages in most of the cases.</p>
+<h3 id="pageio">PageIO</h3>
+<p>Let's first introduce the <em>PageIO</em>, which is used to store the
data on disk.</p>
+<p>A <em>PageIO</em> contains some raw data. As we have to map some logical
data that may be wider than a physical fixed size <em>PageIO</em>, we use potentially
more than one <em>PageIO</em> to store the data, and we link the <em>PageIO</em>s
alltogether.</p>
+<p>Each <em>PageIO</em> has a height bytes pointer at the beginning, pointing
to the next PageIO (or to nothing, if there is no more <em>PageIO</em> in the
chain), plus an extra 4 bytes on the first <em>PageIO</em> to define the number
of bytes stored in the chain of PageIO. Here is the mapping between a logical page and some
PageIOs :</p>
+<p><img alt="PageIO mapping" src="images/PageIOLogical.png" /></p>
+<p>Every <em>PageIO</em>s are contiguous on disk, but the <em>PageIO</em>s
used to store a logical page may be located anywhere on the disk, they don't have to be continuous.</p>
+<p>Here is the structure of a <em>PageIO</em> on disk :</p>
+<ul>
+<li>next page offset (8 bytes) : the offset of the next <em>PageIO</em>,
or -1L if no more <em>PageIO</em> is needed</li>
+<li>data size (4 bytes) : for the first <em>PageIO</em>, the size of the
stored data across all the <em>PageIO</em>s used to store a page.</li>
+<li>data (N bytes) : a block of data, which size will be min( PageSize - offset - data
size, data size) for the first <em>PageIO</em> or min( PageSize - offset, data
size) for any other <em>PageIO</em>s</li>
+</ul>
+<h2 id="logical-structure-mapping-on-disk">Logical structure mapping on disk</h2>
+<p>We will now describe how each logical structure is serialized on disk.</p>
+<h3 id="recordmanager-header">RecordManager header</h3>
+<p>We keep a few bytes at the beginning of the file to store some critical information
about the RecordManager. Here is the list of stored informations :</p>
+<ul>
+<li>The <em>PageIO</em> size (in bytes)</li>
+<li>The number of managed BTrees</li>
+<li>The offset of the first free page</li>
+<li>The offset of the last free page</li>
+</ul>
+<p>Here is a picture that shows the header content :</p>
+<p><img alt="RecordManager header" src="images/RMHEader.png" /></p>
+<p>We keep a track of the free pages (a free page is a PageIO that is not anymore used,
for instance because the data have been deleted.) This is done by keeping a link between each
PageIO and by pointing to the first feee PageIO and to the last free PageIO of this list.</p>
+<blockquote>
+<p><strong>Note</strong> We might get rid of the last free page offset.</p>
+</blockquote>
+<p>At startup, of course, we have no free pages, and those pointers contain the -1
offset.</p>
+<p>This header is stored in a <em>PageIO</em>, at the very beginning of
the file.</p>
+<h3 id="the-recordmanager-structure">The RecordManager structure</h3>
+<p>The <em>RecordManager</em> manages <em>BTree</em>s, and
we have to store them into <em>PageIO</em>s. How do we do that ?</p>
+<p>All the <em>BTree</em>s have a header that contains many informations
about them, and point to a <em>rootPage</em> which is the current root (so the
root for the latest revision). As a <em>RecordManager</em> can manage more than
one <em>BTree</em>, we have to find a way to retreive all the <em>BTree</em>s
at startup : we use an internal link, so that a <em>BTree</em> points to the next
btree. At startup, we read the first <em>BTree</em> which is stored in the second
<em>PageIO</em> in the file (so just after the RecordManager header), then we
read the next <em>BTree</em> pointed by the first <em>BTree</em>,
and so on.</p>
+<h4 id="the-btree-header">The BTree header</h4>
+<p>Each <em>BTree</em> has to keep many informations so that it can be
used. Those informations are :</p>
+<ul>
+<li>revision (8 bytes) : the current revision for this <em>BTree</em>.
This value is updated after each modification in the <em>BTree</em>.</li>
+<li>nbElems (8 bytes) : the total number of elements we have in the <em>BTree</em>.
This is updated after each modification either.</li>
+<li>rootPage offset (8 bytes) : the position in the file where the <em>rootPage</em>
is stored</li>
+<li>nextBtree offset (8 bytes) : the position of the next <em>BTree</em>
header in the file (or -1 if we don't have any other <em>BTree</em>)</li>
+<li>pageSize (4 bytes) : the number of elements we cans store in a <em>Node</em>
or a <em>Leaf</em>. It's not related in any possible way with the <em>PageIO</em>
size.</li>
+<li>nameSize (4 bytes) : The <em>BTree</em> name size</li>
+<li>name (nameSize bytes) : the <em>BTree</em> name</li>
+<li>keySerializerSize (4 bytes) : The size of the java <em>FQCN</em> for
the key serializer</li>
+<li>keySerializer (keySerializerSize bytes) : The java <em>FQCN</em> for
the key serializer</li>
+<li>valueSerializerSize (4 bytes) : The size of the java <em>FQCN</em>
for the value serializer</li>
+<li>valueSerializer (valueSerializerSize bytes): The java <em>FQCN</em>
for the value serializer</li>
+<li>dupsAllowed (1 byte): tells if the <em>BTree</em> can have duplicated
values.</li>
+</ul>
+<p>As we can see, thi sheader can have various length, and if one one the names is
long, we may need more than one PageIOs to store it.</p>
+<p>Here is a diagram which present this data structure on disk :</p>
+<p><img alt="BTreeHeader header" src="images/btreeHeader.png" /></p>
+<p>Note that a <em>BTree</em> header can be stored on one or many <em>IOPage</em>s,
depending on its size.</p>
+<p>All in all, when we have more than one <em>BTree</em> stored in the
file, the content of the file which stores the <em>BTree</em> headers will look
like this one :</p>
+<p><img alt="BTrees" src="images/BTree.png" /></p>
+<p>Note that each <em>BTreeHeader</em> has at least one root page, even
if it contains no data. In this schema, we show the root page just after the <em>BTree</em>
it is associated to, but after a few updates, the root page may perfectly well be stored elswhere
on the disk.</p>
+<h4 id="the-nodes-and-leaves">The Nodes and Leaves</h4>
+<p>Nodes and Leaves are logical <em>BTree</em> pages which are serialized
on disk into one to many <em>PageIO</em>s. They have slightly different data structures,
as <em>Node</em>s contains pointers to <em>Leaves</em>, and no data,
while <em>Leaves</em> contains data. In any case, both contain the keys. The <em>Node</em>
has one ore value than the <em>Leaf</em>, too.</p>
+<p>On disk, each <em>Node</em> and <em>Leaf</em> are stored
in <em>PageIO</em>s, as we said. A <em>Node</em> will have pointers
to some other logical pages, and on disk, those pointers will be offset of the first <em>PageIO</em>
used to store the logical page it points to.</p>
+<p>Here is the <em>Node</em> and <em>Leaf</em> data structures
once serialized :</p>
+<p><img alt="Node and Leaf" src="images/nodeLeaf.png" /></p>
+<p>Note that we store the size of the serialized data : this is necessary as we have
to know how many <em>PageIO</em>s will be needed to store the logical page.</p>
+<p>The <em>rootPage</em> is just a <em>Node</em> or a <em>Leaf</em>.</p>
+<h4 id="potential-improvement">Potential improvement</h4>
+<p>We can get better performance by serializing the data differently. Instead of storing
keys and values as byte arrays prefixed by their length, we could store an array of keys and
values' offsets before the associated byte[]. Here is the resulting data structure, once serialized
:</p>
+<p><img alt="Node and Leaf, improved" src="images/nodeLeaf2.png" /></p>
+<p>(The <em>Node</em> is not described, as it's basically the same data
structure, but with one extra value).</p>
+<p>It does not need more space to serialize the data this way, as the offsets are ints,
and in the previous version, those ints are used to store the length of the keys and values
anyway.</p>
+<p>The gain is that we can have access to a given key and value without having to read
all the previous keys and values. Also we can now read a leaf or a node without having to
deserialize all the keys and values they contain.</p>
+
+
+    <div class="nav">
+        <div class="nav_prev">
+        
+            <a href="2.1-logical-structure.html">2.1 - Logical Structure</a>
+		
+        </div>
+        <div class="nav_up">
+        
+            <a href="../user-guide.html">User Guide</a>
+		
+        </div>
+        <div class="nav_next">
+        
+            <a href="2-.html">2 - </a>
+		
+        </div>
+        <div class="clearfix"></div>
+    </div>
+
+
+                </div><!-- rightColumn -->
+                <div id="endContent"></div>
+            </div><!-- content -->
+            <div id="footer">&copy; 2003-2012, <a href="http://www.apache.org">The
Apache Software Foundation</a> - <a href="./../../privacy-policy.html">Privacy
Policy</a><br />
+                Apache Directory, ApacheDS, Apache Directory Server, Apache Directory Studio,
Apache LDAP API, Apache Triplesec, Triplesec, Apache Mavibot, Mavibot, Apache, the Apache
feather logo, and the Apache Directory project logos are trademarks of The Apache Software
Foundation.
+            </div>
+        </div><!-- container -->
+    </body>
+</html>



Mime
View raw message