directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r795287 - in /directory/apacheds/trunk/jdbm-store/src: main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/
Date Sat, 18 Jul 2009 00:41:13 GMT
Author: elecharny
Date: Sat Jul 18 00:41:12 2009
New Revision: 795287

URL: http://svn.apache.org/viewvc?rev=795287&view=rev
Log:
Remove references to AvlTree[Cursor] to use the ArrayTree[Cursor] instead. This is to fix
DIRSERVER-1377

Added:
    directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleArrayCursor.java
      - copied, changed from r794544, directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleAvlCursor.java
    directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleArrayCursorTest.java
      - copied, changed from r794544, directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleAvlCursorTest.java
Modified:
    directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainer.java
    directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsCursor.java
    directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/IndexValueSerializer.java
    directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
    directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursorTest.java

Modified: directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainer.java?rev=795287&r1=795286&r2=795287&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainer.java
(original)
+++ directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainer.java
Sat Jul 18 00:41:12 2009
@@ -20,7 +20,7 @@
 package org.apache.directory.server.core.partition.impl.btree.jdbm;
 
 
-import org.apache.directory.server.core.avltree.AvlTree;
+import org.apache.directory.server.core.avltree.ArrayTree;
 
 
 /**
@@ -34,20 +34,20 @@
  */
 public class DupsContainer<V>
 {
-    private final AvlTree<V> avlTree;
+    private final ArrayTree<V> arrayTree;
     private final BTreeRedirect btreeRedirect;
 
 
-    DupsContainer( AvlTree<V> avlTree )
+    DupsContainer( ArrayTree<V> arrayTree )
     {
-        this.avlTree = avlTree;
+        this.arrayTree = arrayTree;
         btreeRedirect = null;
     }
 
 
     DupsContainer( BTreeRedirect btreeRedirect )
     {
-        avlTree = null;
+        arrayTree = null;
         this.btreeRedirect = btreeRedirect;
     }
 
@@ -58,20 +58,20 @@
     }
 
 
-    final boolean isAvlTree()
+    final boolean isArrayTree()
     {
-        return avlTree != null;
+        return arrayTree != null;
     }
 
 
-    final AvlTree<V> getAvlTree()
+    final ArrayTree<V> getArrayTree()
     {
-        if ( avlTree == null )
+        if ( arrayTree == null )
         {
-            throw new IllegalStateException( "this is not a avlTree container" );
+            throw new IllegalStateException( "this is not an arrayTree container" );
         }
 
-        return avlTree;
+        return arrayTree;
     }
 
 

Modified: directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsCursor.java?rev=795287&r1=795286&r2=795287&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsCursor.java
(original)
+++ directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsCursor.java
Sat Jul 18 00:41:12 2009
@@ -22,8 +22,8 @@
 
 import jdbm.btree.BTree;
 
-import org.apache.directory.server.core.avltree.AvlTree;
-import org.apache.directory.server.core.avltree.AvlTreeCursor;
+import org.apache.directory.server.core.avltree.ArrayTree;
+import org.apache.directory.server.core.avltree.ArrayTreeCursor;
 import org.apache.directory.server.xdbm.Tuple;
 import org.apache.directory.server.xdbm.AbstractTupleCursor;
 import org.apache.directory.shared.ldap.cursor.Cursor;
@@ -112,10 +112,10 @@
             containerTuple.setBoth( containerCursor.get() );
             DupsContainer<V> values = containerTuple.getValue();
 
-            if ( values.isAvlTree() )
+            if ( values.isArrayTree() )
             {
-                AvlTree<V> set = values.getAvlTree();
-                dupsCursor = new AvlTreeCursor<V>( set );
+                ArrayTree<V> set = values.getArrayTree();
+                dupsCursor = new ArrayTreeCursor<V>( set );
             }
             else
             {
@@ -154,7 +154,7 @@
         checkNotClosed( "afterValue()" );
         /*
          * There is a subtle difference between after and before handling
-         * with dupicate key values.  Say we have the following tuples:
+         * with duplicate key values.  Say we have the following tuples:
          *
          * (0, 0)
          * (1, 1)
@@ -187,10 +187,10 @@
             containerTuple.setBoth( containerCursor.get() );
             DupsContainer<V> values = containerTuple.getValue();
 
-            if ( values.isAvlTree() )
+            if ( values.isArrayTree() )
             {
-                AvlTree<V> set = values.getAvlTree();
-                dupsCursor = new AvlTreeCursor<V>( set );
+                ArrayTree<V> set = values.getArrayTree();
+                dupsCursor = new ArrayTreeCursor<V>( set );
             }
             else
             {
@@ -263,9 +263,9 @@
             containerTuple.setBoth( containerCursor.get() );
             DupsContainer<V> values = containerTuple.getValue();
 
-            if ( containerTuple.getValue().isAvlTree() )
+            if ( containerTuple.getValue().isArrayTree() )
             {
-                dupsCursor = new AvlTreeCursor<V>( values.getAvlTree() );
+                dupsCursor = new ArrayTreeCursor<V>( values.getArrayTree() );
             }
             else
             {
@@ -300,10 +300,10 @@
             containerTuple.setBoth( containerCursor.get() );
             DupsContainer<V> values = containerTuple.getValue();
 
-            if ( values.isAvlTree() )
+            if ( values.isArrayTree() )
             {
-                AvlTree<V> set = values.getAvlTree();
-                dupsCursor = new AvlTreeCursor<V>( set );
+                ArrayTree<V> set = values.getArrayTree();
+                dupsCursor = new ArrayTreeCursor<V>( set );
             }
             else
             {
@@ -355,10 +355,10 @@
                 containerTuple.setBoth( containerCursor.get() );
                 DupsContainer<V> values = containerTuple.getValue();
 
-                if ( values.isAvlTree() )
+                if ( values.isArrayTree() )
                 {
-                    AvlTree<V> set = values.getAvlTree();
-                    dupsCursor = new AvlTreeCursor<V>( set );
+                    ArrayTree<V> set = values.getArrayTree();
+                    dupsCursor = new ArrayTreeCursor<V>( set );
                 }
                 else
                 {
@@ -406,10 +406,10 @@
                 containerTuple.setBoth( containerCursor.get() );
                 DupsContainer<V> values = containerTuple.getValue();
 
-                if ( values.isAvlTree() )
+                if ( values.isArrayTree() )
                 {
-                    AvlTree<V> set = values.getAvlTree();
-                    dupsCursor = new AvlTreeCursor<V>( set );
+                    ArrayTree<V> set = values.getArrayTree();
+                    dupsCursor = new ArrayTreeCursor<V>( set );
                 }
                 else
                 {

Modified: directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/IndexValueSerializer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/IndexValueSerializer.java?rev=795287&r1=795286&r2=795287&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/IndexValueSerializer.java
(original)
+++ directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/IndexValueSerializer.java
Sat Jul 18 00:41:12 2009
@@ -23,9 +23,7 @@
 import java.io.IOException;
 import java.io.ObjectOutputStream;
 
-import org.apache.directory.server.core.avltree.AvlTree;
-import org.apache.directory.server.core.avltree.AvlTreeMarshaller;
-import org.apache.directory.server.core.entry.ServerEntrySerializer;
+import org.apache.directory.server.core.avltree.ArrayTree;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -66,10 +64,10 @@
      */
     public byte[] serialize( Object obj ) throws IOException
     {
-        if ( obj instanceof AvlTree )
+        if ( obj instanceof ArrayTree )
         {
             LOG.debug( "Serializing an AvlTree" );
-            return serialize( (AvlTree<?>)obj );
+            return serialize( (ArrayTree<?>)obj );
         }
         else if ( obj instanceof BTree )
         {
@@ -138,9 +136,9 @@
 
     
     /**
-     * Serialize a BTree value
+     * Serialize a AvlTree value
      */
-    private byte[] serialize( AvlTree<?> avlTree ) throws IOException
+    private byte[] serialize( ArrayTree<?> arrayTree ) throws IOException
     {
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream out = new ObjectOutputStream( baos );

Modified: directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java?rev=795287&r1=795286&r2=795287&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
(original)
+++ directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
Sat Jul 18 00:41:12 2009
@@ -25,10 +25,9 @@
 import jdbm.helper.Serializer;
 import jdbm.helper.TupleBrowser;
 
-import org.apache.directory.server.core.avltree.AvlTree;
-import org.apache.directory.server.core.avltree.AvlTreeCursor;
-import org.apache.directory.server.core.avltree.AvlTreeMarshaller;
-import org.apache.directory.server.core.avltree.LinkedAvlNode;
+import org.apache.directory.server.core.avltree.ArrayMarshaller;
+import org.apache.directory.server.core.avltree.ArrayTree;
+import org.apache.directory.server.core.avltree.ArrayTreeCursor;
 import org.apache.directory.server.core.avltree.Marshaller;
 import org.apache.directory.server.schema.SerializableComparator;
 import org.apache.directory.server.xdbm.Table;
@@ -90,7 +89,7 @@
 
     private final Serializer valueSerializer;
 
-    AvlTreeMarshaller<V> marshaller;
+    Marshaller<ArrayTree<V>> marshaller;
 
 
     // ------------------------------------------------------------------------
@@ -125,12 +124,12 @@
 
         if ( valueSerializer != null )
         {
-            marshaller = new AvlTreeMarshaller<V>( valueComparator,
+            marshaller = new ArrayMarshaller<V>( valueComparator,
                     new MarshallerSerializerBridge<V>( valueSerializer ) );
         }
         else
         {
-            marshaller = new AvlTreeMarshaller<V>( valueComparator );
+            marshaller = new ArrayMarshaller<V>( valueComparator );
         }
 
         if ( keyComparator == null )
@@ -342,9 +341,10 @@
         }
 
         DupsContainer<V> values = getDupsContainer( ( byte[] ) bt.find( key ) );
-        if ( values.isAvlTree() )
+        
+        if ( values.isArrayTree() )
         {
-            return values.getAvlTree().getSize();
+            return values.getArrayTree().size();
         }
 
         return getBTree( values.getBTreeRedirect() ).size();
@@ -380,16 +380,16 @@
 
         
         DupsContainer<V> values = getDupsContainer( ( byte[] ) bt.find( key ) );
-        if ( values.isAvlTree() )
+        if ( values.isArrayTree() )
         {
-            AvlTree<V> set = values.getAvlTree();
+            ArrayTree<V> set = values.getArrayTree();
 
             if ( set.getFirst() == null )
             {
                 return null;
             }
             
-            return set.getFirst().getKey();
+            return set.getFirst();
         }
 
         // Handle values if they are stored in another BTree
@@ -420,10 +420,10 @@
 
         DupsContainer<V> values = getDupsContainer( ( byte[] ) bt.find( key ) );
         
-        if ( values.isAvlTree() )
+        if ( values.isArrayTree() )
         {
-            AvlTree<V> set = values.getAvlTree();
-            LinkedAvlNode<V> result = set.findGreaterOrEqual( val );
+            ArrayTree<V> set = values.getArrayTree();
+            V result = set.findGreaterOrEqual( val );
             return result != null;
         }
 
@@ -452,10 +452,10 @@
 
         DupsContainer<V> values = getDupsContainer( ( byte[] ) bt.find( key ) );
         
-        if ( values.isAvlTree() )
+        if ( values.isArrayTree() )
         {
-            AvlTree<V> set = values.getAvlTree();
-            LinkedAvlNode<V> result = set.findLessOrEqual( val );
+            ArrayTree<V> set = values.getArrayTree();
+            V result = set.findLessOrEqual( val );
             return result != null;
         }
 
@@ -560,9 +560,9 @@
         
         DupsContainer<V> values = getDupsContainer( ( byte[] ) bt.find( key ) );
         
-        if ( values.isAvlTree() )
+        if ( values.isArrayTree() )
         {
-            return values.getAvlTree().find( value ) != null;
+            return values.getArrayTree().find( value ) != null;
         }
         
         return getBTree( values.getBTreeRedirect() ).find( value ) != null;
@@ -618,16 +618,16 @@
             
             DupsContainer<V> values = getDupsContainer( ( byte[] ) bt.find( key ) );
             
-            if ( values.isAvlTree() )
+            if ( values.isArrayTree() )
             {
-                AvlTree<V> set = values.getAvlTree();
+                ArrayTree<V> set = values.getArrayTree();
                 replaced = set.insert( value );
                 
                 if ( replaced != null )// if the value already present returns the same value
                 {
                     return;
                 }
-                if ( set.getSize() > numDupLimit )
+                if ( set.size() > numDupLimit )
                 {
                     BTree tree = convertToBTree( set );
                     BTreeRedirect redirect = new BTreeRedirect( tree.getRecid() );
@@ -719,9 +719,9 @@
     
             DupsContainer<V> values = getDupsContainer( ( byte[] ) bt.find( key ) );
             
-            if ( values.isAvlTree() )
+            if ( values.isArrayTree() )
             {
-                AvlTree<V> set = values.getAvlTree();
+                ArrayTree<V> set = values.getArrayTree();
     
                 // If removal succeeds then remove if set is empty else replace it
                 if ( set.remove( value ) != null )
@@ -760,7 +760,7 @@
                      */
                     if ( tree.size() <= numDupLimit )
                     {
-                        AvlTree<V> avlTree = convertToAvlTree( tree );
+                        ArrayTree<V> avlTree = convertToArrayTree( tree );
                         bt.insert( key, marshaller.serialize( avlTree ), true );
                         recMan.delete( tree.getRecid() );
                     }
@@ -840,8 +840,8 @@
             }
             else
             {
-                AvlTree<V> set = marshaller.deserialize( serialized );
-                this.count -= set.getSize();
+                ArrayTree<V> set = marshaller.deserialize( serialized );
+                this.count -= set.size();
     
                 if ( LOG.isDebugEnabled() )
                 {
@@ -902,8 +902,8 @@
             return new KeyTupleBTreeCursor<K,V>( tree, key, valueComparator );
         }
 
-        AvlTree<V> set = marshaller.deserialize( serialized );
-        return new KeyTupleAvlCursor<K,V>( set, key );
+        ArrayTree<V> set = marshaller.deserialize( serialized );
+        return new KeyTupleArrayCursor<K,V>( set, key );
     }
 
 
@@ -934,7 +934,7 @@
             return new KeyBTreeCursor<V>( tree, valueComparator );
         }
 
-        return new AvlTreeCursor<V>( marshaller.deserialize( serialized ) );
+        return new ArrayTreeCursor<V>( marshaller.deserialize( serialized ) );
     }
 
 
@@ -964,7 +964,7 @@
     }
 
     
-    public Marshaller<AvlTree<V>> getMarshaller()
+    public Marshaller<ArrayTree<V>> getMarshaller()
     {
         return marshaller;
     }
@@ -977,7 +977,7 @@
     {
         if ( serialized == null )
         {
-            return new DupsContainer<V>( new AvlTree<V>( valueComparator ) );
+            return new DupsContainer<V>( new ArrayTree<V>( valueComparator )
);
         }
 
         if ( BTreeRedirectMarshaller.isRedirect( serialized ) )
@@ -1051,9 +1051,9 @@
 
 
     @SuppressWarnings("unchecked")
-    private AvlTree<V> convertToAvlTree( BTree bTree ) throws IOException
+    private ArrayTree<V> convertToArrayTree( BTree bTree ) throws IOException
     {
-        AvlTree<V> avlTree = new AvlTree<V>( valueComparator );
+        ArrayTree<V> avlTree = new ArrayTree<V>( valueComparator );
         TupleBrowser browser = bTree.browse();
         jdbm.helper.Tuple tuple = new jdbm.helper.Tuple();
         
@@ -1066,7 +1066,7 @@
     }
     
 
-    private BTree convertToBTree( AvlTree<V> avlTree ) throws Exception
+    private BTree convertToBTree( ArrayTree<V> arrayTree ) throws Exception
     {
         BTree bTree;
 
@@ -1079,7 +1079,7 @@
             bTree = BTree.createInstance( recMan, valueComparator );
         }
 
-        Cursor<V> keys = new AvlTreeCursor<V>( avlTree );
+        Cursor<V> keys = new ArrayTreeCursor<V>( arrayTree );
         keys.beforeFirst();
         
         while ( keys.next() )

Copied: directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleArrayCursor.java
(from r794544, directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleAvlCursor.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleArrayCursor.java?p2=directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleArrayCursor.java&p1=directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleAvlCursor.java&r1=794544&r2=795287&rev=795287&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleAvlCursor.java
(original)
+++ directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleArrayCursor.java
Sat Jul 18 00:41:12 2009
@@ -21,22 +21,22 @@
 
 import org.apache.directory.server.xdbm.Tuple;
 import org.apache.directory.server.xdbm.AbstractTupleCursor;
-import org.apache.directory.server.core.avltree.AvlTree;
-import org.apache.directory.server.core.avltree.AvlTreeCursor;
+import org.apache.directory.server.core.avltree.ArrayTree;
+import org.apache.directory.server.core.avltree.ArrayTreeCursor;
 import org.apache.directory.shared.ldap.cursor.InvalidCursorPositionException;
 
 
 /**
  * Cursor over a set of values for the same key which are store in an in
- * memory AvlTree.  This Cursor is limited to the same key and it's tuples
+ * memory ArrayTree.  This Cursor is limited to the same key and it's tuples
  * will always return the same key.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class KeyTupleAvlCursor<K,V> extends AbstractTupleCursor<K,V>
+public class KeyTupleArrayCursor<K,V> extends AbstractTupleCursor<K,V>
 {
-    private final AvlTreeCursor<V> wrapped;
+    private final ArrayTreeCursor<V> wrapped;
     private final K key;
 
     private Tuple<K,V> returnedTuple = new Tuple<K,V>();
@@ -44,15 +44,15 @@
 
 
     /**
-     * Creates a Cursor over the tuples of an AvlTree.
+     * Creates a Cursor over the tuples of an ArrayTree.
      *
-     * @param avlTree the AvlTree to build a Tuple returning Cursor over
+     * @param avlTree the ArrayTree to build a Tuple returning Cursor over
      * @param key the constant key for which values are returned
      */
-    public KeyTupleAvlCursor( AvlTree<V> avlTree, K key )
+    public KeyTupleArrayCursor( ArrayTree<V> arrayTree, K key )
     {
         this.key = key;
-        this.wrapped = new AvlTreeCursor<V>( avlTree );
+        this.wrapped = new ArrayTreeCursor<V>( arrayTree );
     }
 
 

Modified: directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursorTest.java?rev=795287&r1=795286&r2=795287&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursorTest.java
(original)
+++ directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursorTest.java
Sat Jul 18 00:41:12 2009
@@ -150,7 +150,7 @@
 
         Tuple<Integer,DupsContainer<Integer>> tuple = cursor.get();
         assertTrue( tuple.getKey().equals( 1 ) );
-        assertEquals( 1, ( int ) tuple.getValue().getAvlTree().getFirst().getKey() );
+        assertEquals( 1, ( int ) tuple.getValue().getArrayTree().getFirst() );
 
         cursor.beforeFirst();
         assertFalse( cursor.previous() );
@@ -174,13 +174,13 @@
 
         Tuple<Integer,DupsContainer<Integer>> tuple = cursor.get();
         assertTrue( tuple.getKey().equals( 3 ) );
-        assertEquals( 3, ( int ) tuple.getValue().getAvlTree().getFirst().getKey() );
+        assertEquals( 3, ( int ) tuple.getValue().getArrayTree().getFirst() );
 
         cursor.before( new Tuple<Integer,DupsContainer<Integer>>( 7, null ) );
         cursor.next();
         tuple = cursor.get();
         assertTrue( tuple.getKey().equals( 7 ) );
-        assertEquals( 7, ( int ) tuple.getValue().getAvlTree().getFirst().getKey() );
+        assertEquals( 7, ( int ) tuple.getValue().getArrayTree().getFirst() );
 
         cursor.last();
         cursor.next();
@@ -193,7 +193,7 @@
         cursor.next();
         tuple = cursor.get();
         assertTrue( tuple.getKey().equals( 1 ) );
-        assertEquals( 1, ( int ) tuple.getValue().getAvlTree().getFirst().getKey() );
+        assertEquals( 1, ( int ) tuple.getValue().getArrayTree().getFirst() );
 
         cursor.afterLast();
         assertFalse( cursor.next() );
@@ -209,7 +209,7 @@
         cursor.next(); // this moves onto tuple with key 2
         tuple = cursor.get();
         assertTrue( tuple.getKey().equals( 2 ) );
-        assertEquals( 2, ( int ) tuple.getValue().getAvlTree().getFirst().getKey() );
+        assertEquals( 2, ( int ) tuple.getValue().getArrayTree().getFirst() );
     }
 
 

Copied: directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleArrayCursorTest.java
(from r794544, directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleAvlCursorTest.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleArrayCursorTest.java?p2=directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleArrayCursorTest.java&p1=directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleAvlCursorTest.java&r1=794544&r2=795287&rev=795287&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleAvlCursorTest.java
(original)
+++ directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleArrayCursorTest.java
Sat Jul 18 00:41:12 2009
@@ -24,7 +24,7 @@
 
 import java.util.Comparator;
 
-import org.apache.directory.server.core.avltree.AvlTree;
+import org.apache.directory.server.core.avltree.ArrayTree;
 import org.apache.directory.server.xdbm.Tuple;
 import org.apache.directory.shared.ldap.cursor.InvalidCursorPositionException;
 import org.junit.Before;
@@ -37,12 +37,12 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class KeyTupleAvlCursorTest
+public class KeyTupleArrayCursorTest
 {
 
-    AvlTree<Integer> tree;
+    ArrayTree<Integer> tree;
     Comparator<Integer> comparator;
-    KeyTupleAvlCursor<Integer, Integer> cursor;
+    KeyTupleArrayCursor<Integer, Integer> cursor;
     
     private static final Integer KEY = new Integer( 1 );
     
@@ -59,9 +59,9 @@
         
         };
         
-      tree = new AvlTree<Integer>( comparator );  
+      tree = new ArrayTree<Integer>( comparator );  
       
-      cursor = new KeyTupleAvlCursor<Integer, Integer>( tree, KEY );
+      cursor = new KeyTupleArrayCursor<Integer, Integer>( tree, KEY );
     }
     
     



Mime
View raw message