You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2017/10/16 10:14:52 UTC
svn commit: r1812272 - in
/directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree:
AbstractPage.java KeyCursor.java Node.java
Author: elecharny
Date: Mon Oct 16 10:14:52 2017
New Revision: 1812272
URL: http://svn.apache.org/viewvc?rev=1812272&view=rev
Log:
Moved the children array out of AbstractPage up to Node where it deserves to be stored
Modified:
directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractPage.java
directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree/KeyCursor.java
directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree/Node.java
Modified: directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractPage.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractPage.java?rev=1812272&r1=1812271&r2=1812272&view=diff
==============================================================================
--- directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractPage.java (original)
+++ directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree/AbstractPage.java Mon Oct 16 10:14:52 2017
@@ -41,9 +41,6 @@ import java.lang.reflect.Array;
/** Keys of children nodes */
protected KeyHolder<K>[] keys;
- /** Children pages associated with keys. */
- protected long[] children;
-
/** The number of current values in the Page */
protected int pageNbElems;
Modified: directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree/KeyCursor.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree/KeyCursor.java?rev=1812272&r1=1812271&r2=1812272&view=diff
==============================================================================
--- directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree/KeyCursor.java (original)
+++ directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree/KeyCursor.java Mon Oct 16 10:14:52 2017
@@ -107,7 +107,7 @@ public class KeyCursor<K>
parentPos.pos = parentPos.page.getPageNbElems();
}
- child = transaction.getPage( btreeInfo, ( ( AbstractPage )parentPos.page ).children[parentPos.pos] );
+ child = transaction.getPage( btreeInfo, ( ( Node )parentPos.page ).children[parentPos.pos] );
}
// and leaf
@@ -150,7 +150,7 @@ public class KeyCursor<K>
parentPos.page = child;
}
- child = transaction.getPage( btreeInfo, ( ( AbstractPage )parentPos.page ).children[0] );
+ child = transaction.getPage( btreeInfo, ( ( Node )parentPos.page ).children[0] );
}
// and leaf
@@ -600,7 +600,7 @@ public class KeyCursor<K>
{
// We can pick the next element at this level
parentPos.pos++;
- child = transaction.getPage( btreeInfo, ( ( AbstractPage )parentPos.page ).children[parentPos.pos] );
+ child = transaction.getPage( btreeInfo, ( ( Node )parentPos.page ).children[parentPos.pos] );
// and go down the tree through the nodes
while ( currentDepth < depth - 1 )
@@ -609,7 +609,7 @@ public class KeyCursor<K>
parentPos = stack[currentDepth];
parentPos.pos = 0;
parentPos.page = child;
- child = transaction.getPage( btreeInfo, ( ( AbstractPage )parentPos.page ).children[0] );
+ child = transaction.getPage( btreeInfo, ( ( Node )parentPos.page ).children[0] );
}
// and the leaf
@@ -659,7 +659,7 @@ public class KeyCursor<K>
{
// We can pick the next element at this level
parentPos.pos--;
- child = transaction.getPage( btreeInfo, ( ( AbstractPage )parentPos.page ).children[parentPos.pos] );
+ child = transaction.getPage( btreeInfo, ( ( Node )parentPos.page ).children[parentPos.pos] );
// and go down the tree through the nodes
while ( currentDepth < depth - 1 )
@@ -668,7 +668,7 @@ public class KeyCursor<K>
parentPos = stack[currentDepth];
parentPos.pos = child.getPageNbElems();
parentPos.page = child;
- child = transaction.getPage( btreeInfo, ( ( AbstractPage )parentPos.page ).children[parentPos.page.getPageNbElems()] );
+ child = transaction.getPage( btreeInfo, ( ( Node )parentPos.page ).children[parentPos.page.getPageNbElems()] );
}
// and the leaf
@@ -717,13 +717,13 @@ public class KeyCursor<K>
else
{
// We can pick the previous element at this level
- child = transaction.getPage( btreeInfo, ( ( AbstractPage )parentPos.page ).children[parentPos.pos - 1] );
+ child = transaction.getPage( btreeInfo, ( ( Node )parentPos.page ).children[parentPos.pos - 1] );
// and go down the tree through the nodes
while ( currentDepth < depth - 1 )
{
currentDepth++;
- child = transaction.getPage( btreeInfo, ( ( AbstractPage )child ).children[child.getPageNbElems()] );
+ child = transaction.getPage( btreeInfo, ( ( Node )child ).children[child.getPageNbElems()] );
}
return true;
Modified: directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree/Node.java
URL: http://svn.apache.org/viewvc/directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree/Node.java?rev=1812272&r1=1812271&r2=1812272&view=diff
==============================================================================
--- directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree/Node.java (original)
+++ directory/mavibot/branches/single-value/mavibot/src/main/java/org/apache/directory/mavibot/btree/Node.java Mon Oct 16 10:14:52 2017
@@ -44,6 +44,9 @@ import org.apache.directory.mavibot.btre
*/
/* No qualifier */class Node<K, V> extends AbstractPage<K, V>
{
+ /** Children pages associated with keys. */
+ protected long[] children;
+
/**
* Creates a new Node which will contain only one key, with references to
* a left and right page. This is a specific constructor used by the btree