directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1547456 - in /directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed: Leaf.java ParentPos.java
Date Tue, 03 Dec 2013 16:17:09 GMT
Author: elecharny
Date: Tue Dec  3 16:17:09 2013
New Revision: 1547456

URL: http://svn.apache.org/r1547456
Log:
The value cursor is now created in the Leaf

Added:
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/ParentPos.java
      - copied, changed from r1547056, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/ParentPos.java
Modified:
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/Leaf.java

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/Leaf.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/Leaf.java?rev=1547456&r1=1547455&r2=1547456&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/Leaf.java
(original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/Leaf.java
Tue Dec  3 16:17:09 2013
@@ -651,6 +651,9 @@ import org.apache.directory.mavibot.btre
 
             // Start at the beginning of the page
             ParentPos<K, V> parentPos = new ParentPos<K, V>( this, pos );
+            
+            // Create the value cursor
+            parentPos.valueCursor = values[pos].getCursor();
 
             stack[depth] = parentPos;
 
@@ -662,7 +665,10 @@ import org.apache.directory.mavibot.btre
             if ( pos < nbElems )
             {
                 ParentPos<K, V> parentPos = new ParentPos<K, V>( this, pos );
-                
+
+                // Create the value cursor
+                parentPos.valueCursor = values[pos].getCursor();
+
                 stack[depth] = parentPos;
 
                 cursor = new TupleCursorImpl<K, V>( btree, transaction, stack, depth
);
@@ -671,6 +677,9 @@ import org.apache.directory.mavibot.btre
             {
                 // after the last element
                 ParentPos<K, V> parentPos = new ParentPos<K, V>( this, nbElems
- 1 );
+
+                // Create the value cursor
+                parentPos.valueCursor = values[nbElems - 1].getCursor();
                 
                 stack[depth] = parentPos;
 
@@ -718,6 +727,9 @@ import org.apache.directory.mavibot.btre
         {
             // Start at the beginning of the page
             ParentPos<K, V> parentPos = new ParentPos<K, V>( this, pos );
+            
+            // Create the value cursor
+            parentPos.valueCursor = values[0].getCursor();
 
             stack[depth] = parentPos;
 

Copied: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/ParentPos.java
(from r1547056, directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/ParentPos.java)
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/ParentPos.java?p2=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/ParentPos.java&p1=directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/ParentPos.java&r1=1547056&r2=1547456&rev=1547456&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/ParentPos.java
(original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/ParentPos.java
Tue Dec  3 16:17:09 2013
@@ -52,20 +52,6 @@ import org.apache.directory.mavibot.btre
     {
         this.page = page;
         this.pos = pos;
-        
-        if ( page instanceof Leaf )
-        {
-            try
-            {
-                ValueHolder<V> valueHolder = ( ( Leaf<K, V> ) page ).getValue(
pos );
-                
-                valueCursor = valueHolder.getCursor();
-            }
-            catch ( IllegalArgumentException e )
-            {
-                e.printStackTrace();
-            }
-        }
     }
 
 



Mime
View raw message