Return-Path: X-Original-To: apmail-directory-commits-archive@www.apache.org Delivered-To: apmail-directory-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 629C51084F for ; Sun, 24 Nov 2013 18:10:14 +0000 (UTC) Received: (qmail 93090 invoked by uid 500); 24 Nov 2013 18:10:14 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 93058 invoked by uid 500); 24 Nov 2013 18:10:14 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 93051 invoked by uid 99); 24 Nov 2013 18:10:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 24 Nov 2013 18:10:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_FRT_BEFORE X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 24 Nov 2013 18:10:08 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 400F02388AC8 for ; Sun, 24 Nov 2013 18:09:48 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r887915 - in /websites/staging/directory/trunk/content: ./ mavibot/user-guide/4-btree-operations.html Date: Sun, 24 Nov 2013 18:09:48 -0000 To: commits@directory.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131124180948.400F02388AC8@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: buildbot Date: Sun Nov 24 18:09:47 2013 New Revision: 887915 Log: Staging update by buildbot for directory Modified: websites/staging/directory/trunk/content/ (props changed) websites/staging/directory/trunk/content/mavibot/user-guide/4-btree-operations.html Propchange: websites/staging/directory/trunk/content/ ------------------------------------------------------------------------------ --- cms:source-revision (original) +++ cms:source-revision Sun Nov 24 18:09:47 2013 @@ -1 +1 @@ -1545020 +1545023 Modified: websites/staging/directory/trunk/content/mavibot/user-guide/4-btree-operations.html ============================================================================== --- websites/staging/directory/trunk/content/mavibot/user-guide/4-btree-operations.html (original) +++ websites/staging/directory/trunk/content/mavibot/user-guide/4-btree-operations.html Sun Nov 24 18:09:47 2013 @@ -146,11 +146,11 @@

4 - BTree operations

-

We will now list all the possible operations that can be applied on a BTree. But first, let's introduce the Cursor interface, as it's used by all the browse operation.

+

We will now list all the possible operations that can be applied on a BTree. But first, let us understand the Cursor interface, as it's used for navigating a BTree using various types of browse operations.

4.1 The Cursor interface

-

All the browse operations will return a Cursor instance. A Cursor allows one to move forward and backward on a BTree. It starts at a specific position, and can be moved to a specific position too. The default position for a Cursor is before the very first element of the BTree

+

All the browse operations will return a Cursor instance. A Cursor allows navigating forward and backward on a BTree. It starts at a specific position, and can be moved to a specific position too. The default position for a Cursor is before the very first element of the BTree

-It's important to understand that a Cursor returns tuples, not keys. A Key may be associated to many values, so a cursor may return many tuples with a given key (each one will have a different value though). +It's important to understand that a Cursor returns tuples, not keys. A Key may be associated with many values, so a cursor may return many tuples with a given key (each one will have a different value though).

Here is the BTree sample we will use for the following examples :

@@ -159,34 +159,36 @@ It's important to understand that a C

4.1.1.1 afterLast

Moves the current position after the last element (last key and last value). The following schema shows the new position of the pointer after having called the afterLast() method :

After Last

-

As we can see, we are not pointing any tuple nor any key.

+

As we can see, we are not pointing at any key.

4.1.1.2 beforeFirst

Moves the current position before the first element (first key and first value). The following schema shows the new position of the pointer after having called the beforeFirst() method :

Before First

-

As we can see, we are not pointing any tuple nor any key.

+

In this case also cursor is not stationed at any key.

4.1.2 Cursor operations

-

We have to sets of methods depending on the elements we are browsing : tuples or keys. Operations on tuples may return many tuples with the same key (actually, one per value), when operations on keys just return one tuple containing the key and the first value for this key.

+

When a cursor is used to browse Tuples it may return many tuples with the same key but different value, when used to browse keys a +single tuple will be returned for each key with the value of the key (when multiple values are present only the first value will be +returned).

4.1.2.1 hasNext

-

Tells if there is a next available tuple. This will always be true if we are before the first tuple, and always be fore if we are on the last tuple or after the last tuple. The following picture shows the returned value for calls in various cases :

+

Tells if there is a next available tuple. This will always be true if we are before the first tuple, and always false if we are on the last tuple or after the last tuple. The following picture shows the returned value for calls in various cases :

Has Next

4.1.2.2 hasPrev

-

Tells if there is a previous available tuple

+

Returns true if there is a tuple available before the current tuple.

4.1.2.3 next

-

Moves to the next value, or to the next key if all the values have been processed, and return the associated tuple

+

Moves to the next value of the current key or to the next key if all the values of the current key have been processed, and return the associated tuple.

4.1.2.4 prev

-

Moves to the previous value, or to the next key if all the values have been processed, and return the associated tuple

+

Moves to the previous value of the current key or to the previous key if all the values of the current key have been processed, and return the associated tuple.

4.1.2.5 hasNextKey

-

Tells if there is a next available key

+

Tells if there is a key after the current key.

4.1.2.6 hasPrevKey

-

Tells if there is a previous available key

+

Tells if there is a previous key before the current key.

4.1.2.7 nextKey

-

Moves to the next key, even if we have more values to process

+

Moves(jumps) to the next key, even if not all values of the current key are navigated.

4.1.2.8 prevKey

-

Moves to the previous key, even if we have more values to process

+

Moves(jumps) to the previous key, even if not all values of the current key are navigated.

4.1 Browse Operations

-

Now that we know what the Cursor is about, we can describe the various browse operations.

+

Now that we know what a Cursor is about, we can describe the various browse operations.

4.1.1 browse()

-

This method returns a cursor wich position will be set before the first key in the BTree.

+

This method returns a cursor with the position set before the first key of the BTree.