directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r642072 - in /directory/sandbox/akarasulu/bigbang/apacheds/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 Fri, 28 Mar 2008 02:46:59 GMT
Author: akarasulu
Date: Thu Mar 27 19:46:56 2008
New Revision: 642072

URL: http://svn.apache.org/viewvc?rev=642072&view=rev
Log:
workaround for problem where direction change causes jdbm browser to do no-op on getNext()
or getPrevious()

Modified:
    directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
    directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursor.java
    directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursorTest.java

Modified: directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java?rev=642072&r1=642071&r2=642072&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
Thu Mar 27 19:46:56 2008
@@ -790,7 +790,7 @@
         if ( BTreeRedirectMarshaller.isRedirect( serialized ) )
         {
             BTree tree = getBTree( BTreeRedirectMarshaller.INSTANCE.deserialize( serialized
) );
-            return new KeyTupleBTreeCursor<K,V>( tree, key, keyComparator );
+            return new KeyTupleBTreeCursor<K,V>( tree, key, valueComparator );
         }
 
         AvlTree<V> set = marshaller.deserialize( serialized );

Modified: directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursor.java?rev=642072&r1=642071&r2=642072&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursor.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursor.java
Thu Mar 27 19:46:56 2008
@@ -62,6 +62,7 @@
         this.key = key;
         this.btree = btree;
         this.comparator = comparator;
+        this.browser = btree.browse();
     }
 
 
@@ -174,6 +175,12 @@
     {
         if ( browser.getPrevious( valueTuple ) )
         {
+            // work around to fix direction change problem with jdbm browser
+            if ( returnedTuple.getValue() != null &&
+                comparator.compare( ( V ) valueTuple.getKey(), returnedTuple.getValue() )
== 0 )
+            {
+                browser.getPrevious( valueTuple ) ;
+            }
             returnedTuple.setKey( key );
             returnedTuple.setValue( ( V ) valueTuple.getKey() );
             return valueAvailable = true;
@@ -190,6 +197,12 @@
     {
         if ( browser.getNext( valueTuple ) )
         {
+            // work around to fix direction change problem with jdbm browser
+            if ( returnedTuple.getValue() != null &&
+                 comparator.compare( ( V ) valueTuple.getKey(), returnedTuple.getValue()
) == 0 )
+            {
+                browser.getNext( valueTuple ) ;
+            }
             returnedTuple.setKey( key );
             returnedTuple.setValue( ( V ) valueTuple.getKey() );
             return valueAvailable = true;

Modified: directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursorTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursorTest.java?rev=642072&r1=642071&r2=642072&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursorTest.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursorTest.java
Thu Mar 27 19:46:56 2008
@@ -113,7 +113,7 @@
         cursor.get(); // should throw InvalidCursorPositionException
     }
     
-    @Ignore
+
     @Test
     public void testNonEmptyCursor() throws Exception
     {



Mime
View raw message