directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1538542 - in /directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed: InternalUtil.java ParentPos.java TupleCursorImpl.java
Date Mon, 04 Nov 2013 10:12:52 GMT
Author: elecharny
Date: Mon Nov  4 10:12:52 2013
New Revision: 1538542

URL: http://svn.apache.org/r1538542
Log:
o Rename dupsContaier to valueHolder
o Fixed some methods in InternalUtils, they weren't initializing correctly the parentPos.valueHolder

Modified:
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/InternalUtil.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/ParentPos.java
    directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/TupleCursorImpl.java

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/InternalUtil.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/InternalUtil.java?rev=1538542&r1=1538541&r2=1538542&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/InternalUtil.java
(original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/InternalUtil.java
Mon Nov  4 10:12:52 2013
@@ -49,11 +49,10 @@ import java.io.IOException;
             return;
         }
 
-        if ( parentPos.dupsContainer == null )
+        if ( parentPos.valueHolder == null )
         {
             Leaf leaf = ( Leaf ) ( parentPos.page );
-            ValueHolder valueHolder = leaf.values[parentPos.pos];
-
+            parentPos.valueHolder = leaf.values[parentPos.pos];
         }
     }
 
@@ -76,7 +75,7 @@ import java.io.IOException;
         if ( parentPos.pos < parentPos.page.getNbElems() )
         {
             Leaf leaf = ( Leaf ) ( parentPos.page );
-            ValueHolder valueHolder = leaf.values[parentPos.pos];
+            parentPos.valueHolder = leaf.values[parentPos.pos];
         }
     }
 
@@ -101,7 +100,7 @@ import java.io.IOException;
         if ( index >= 0 )
         {
             Leaf leaf = ( Leaf ) ( parentPos.page );
-            ValueHolder valueHolder = leaf.values[index];
+            parentPos.valueHolder = leaf.values[index];
         }
     }
 

Modified: 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?rev=1538542&r1=1538541&r2=1538542&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
Mon Nov  4 10:12:52 2013
@@ -41,7 +41,7 @@ package org.apache.directory.mavibot.btr
     /* No qualifier*/int dupPos;
 
     /** the container of duplicate key's values. The tuples will be stored as <V,null>*/
-    /* No qualifier*/BTree<V, V> dupsContainer;
+    /* No qualifier*/ValueHolder<V> valueHolder;
 
 
     /**

Modified: directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/TupleCursorImpl.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/TupleCursorImpl.java?rev=1538542&r1=1538541&r2=1538542&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/TupleCursorImpl.java
(original)
+++ directory/mavibot/trunk/mavibot/src/main/java/org/apache/directory/mavibot/btree/managed/TupleCursorImpl.java
Mon Nov  4 10:12:52 2013
@@ -304,11 +304,11 @@ public class TupleCursorImpl<K, V> imple
         {
             if ( allowDuplicates && ( p.page instanceof Leaf ) )
             {
-                if ( ( p.dupsContainer == null ) && ( p.pos != p.page.getNbElems()
) )
+                if ( ( p.valueHolder == null ) && ( p.pos != p.page.getNbElems()
) )
                 {
                     return true;
                 }
-                else if ( ( p.dupsContainer != null ) && ( p.dupPos != p.dupsContainer.getNbElems()
)
+                else if ( ( p.valueHolder != null ) && ( p.dupPos != p.valueHolder.size()
)
                     && ( p.pos != p.page.getNbElems() ) )
                 {
                     return true;
@@ -343,11 +343,11 @@ public class TupleCursorImpl<K, V> imple
         {
             if ( allowDuplicates && ( p.page instanceof Leaf ) )
             {
-                if ( ( p.dupsContainer == null ) && ( p.pos != 0 ) )
+                if ( ( p.valueHolder == null ) && ( p.pos != 0 ) )
                 {
                     return true;
                 }
-                else if ( ( p.dupsContainer != null ) &&
+                else if ( ( p.valueHolder != null ) &&
                     ( ( p.dupPos != 0 ) || ( p.pos != 0 ) ) )
                 {
                     return true;
@@ -533,9 +533,8 @@ public class TupleCursorImpl<K, V> imple
         {
             ParentPos<K, V> tmp = new ParentPos<K, V>( o.page, o.pos );
             tmp.dupPos = o.dupPos;
-            tmp.dupsContainer = o.dupsContainer;
+            tmp.valueHolder = o.valueHolder;
             clone.add( tmp );
         }
     }
-
 }



Mime
View raw message