directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r604375 - in /directory/sandbox/akarasulu/bigbang/apacheds: btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/ core-shared/src/main/java/org/apache/directory/server/core/cursor/ jdbm-store/src/main/java/org/apac...
Date Sat, 15 Dec 2007 02:45:03 GMT
Author: akarasulu
Date: Fri Dec 14 18:44:53 2007
New Revision: 604375

URL: http://svn.apache.org/viewvc?rev=604375&view=rev
Log:
added additional cursor methods to try to see if we can bypass TupleBrowsers all together

Added:
    directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/BTreeTupleCursor.java
Modified:
    directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/NoDupsCursor.java
    directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/ValueArrayCursor.java
    directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/AbstractCursor.java
    directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/Cursor.java
    directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/EmptyCursor.java
    directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/IteratorCursor.java
    directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/ListCursor.java
    directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/SingletonCursor.java
    directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/BTreeTupleEnumeration.java
    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/JdbmTupleBrowser.java

Modified: directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/NoDupsCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/NoDupsCursor.java?rev=604375&r1=604374&r2=604375&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/NoDupsCursor.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/NoDupsCursor.java
Fri Dec 14 18:44:53 2007
@@ -92,14 +92,26 @@
      */
     private void beforeKey( Object key ) throws IOException
     {
+        browser = factory.beforeKey( key );
         beforeFirst = false;
         afterLast = false;
-        success = true;
         size = factory.size();
         pos = BEFORE_FIRST;
-        browser = factory.beforeKey( key );
+        success = true;
 
         throw new NotImplementedException( "Need to fix the todo on this before going further"
);
+    }
+
+
+    public boolean before( Tuple element ) throws IOException
+    {
+        throw new NotImplementedException();
+    }
+
+
+    public boolean after( Tuple element ) throws IOException
+    {
+        throw new NotImplementedException();
     }
 
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/ValueArrayCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/ValueArrayCursor.java?rev=604375&r1=604374&r2=604375&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/ValueArrayCursor.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/ValueArrayCursor.java
Fri Dec 14 18:44:53 2007
@@ -22,6 +22,7 @@
 import org.apache.directory.server.core.cursor.Cursor;
 import org.apache.directory.server.core.cursor.CursorClosedException;
 import org.apache.directory.server.core.cursor.InvalidCursorPositionException;
+import org.apache.directory.shared.ldap.NotImplementedException;
 
 import java.io.IOException;
 import java.util.Arrays;
@@ -69,6 +70,18 @@
             throw new CursorClosedException( "Attempting " + operation
                     + " operation on a closed Cursor." );
         }
+    }
+
+
+    public boolean before( Tuple element ) throws IOException
+    {
+        throw new NotImplementedException();
+    }
+
+
+    public boolean after( Tuple element ) throws IOException
+    {
+        throw new NotImplementedException();
     }
 
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/AbstractCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/AbstractCursor.java?rev=604375&r1=604374&r2=604375&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/AbstractCursor.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/AbstractCursor.java
Fri Dec 14 18:44:53 2007
@@ -25,7 +25,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public abstract class AbstractCursor<T> implements Cursor<T>
+public abstract class AbstractCursor<E> implements Cursor<E>
 {
     protected static final int BEFORE_FIRST = -1;
     private boolean closed;

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/Cursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/Cursor.java?rev=604375&r1=604374&r2=604375&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/Cursor.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/Cursor.java
Fri Dec 14 18:44:53 2007
@@ -18,6 +18,7 @@
  */
 package org.apache.directory.server.core.cursor;
 
+
 import java.io.IOException;
 
 
@@ -40,6 +41,34 @@
  */
 public interface Cursor<E>
 {
+    /**
+     * Positions this Cursor just before the element.  If the element value
+     * does not exist in the dataset, the Cursor is advanced to a data element
+     * with the greatest value in the dataset less than the element argument.
+     *
+     * @param element the element to be positioned before
+     * @return true if get() will yeild a valid value, false otherwise
+     * @throws IOException if there are problems positioning this cursor or if
+     * this Cursor is closed
+     * @throws UnsupportedOperationException if this operation is not supported
+     */
+    boolean before( E element ) throws IOException;
+
+
+    /**
+     * Positions this Cursor just after the element.  If the element value
+     * does not exist in the dataset, the Cursor is advanced to a data element
+     * with the smallest value in the dataset greater than the element argument.
+     *
+     * @param element the element to be positioned after
+     * @return true if get() will yeild a valid value, false otherwise
+     * @throws IOException if there are problems positioning this cursor or if
+     * this Cursor is closed
+     * @throws UnsupportedOperationException if this operation is not supported
+     */
+    boolean after( E element ) throws IOException;
+
+
     /**
      * Positions this Curser before the first element.
      *

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/EmptyCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/EmptyCursor.java?rev=604375&r1=604374&r2=604375&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/EmptyCursor.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/EmptyCursor.java
Fri Dec 14 18:44:53 2007
@@ -28,8 +28,22 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class EmptyCursor<E> extends AbstractCursor
+public class EmptyCursor<E> extends AbstractCursor<E>
 {
+    public boolean before( E element ) throws IOException
+    {
+        checkClosed( "before()" );
+        return false;
+    }
+
+
+    public boolean after( E element ) throws IOException
+    {
+        checkClosed( "after()" );
+        return false;
+    }
+
+
     public void beforeFirst() throws CursorClosedException
     {
         checkClosed( "beforeFirst()" );

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/IteratorCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/IteratorCursor.java?rev=604375&r1=604374&r2=604375&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/IteratorCursor.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/IteratorCursor.java
Fri Dec 14 18:44:53 2007
@@ -28,10 +28,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class IteratorCursor<E> extends AbstractCursor
+public class IteratorCursor<E> extends AbstractCursor<E>
 {
     private final Iterator<E> values;
-    private Object current;
+    private E current;
 
 
     public IteratorCursor( Iterator<E> values )
@@ -40,6 +40,18 @@
     }
 
 
+    public boolean before( E element ) throws IOException
+    {
+        throw new UnsupportedOperationException( "Cannot advance before an element on the
underlying Iterator." );
+    }
+
+
+    public boolean after( E element ) throws IOException
+    {
+        throw new UnsupportedOperationException( "Cannot advance after an element on the
underlying Iterator." );
+    }
+
+
     public void beforeFirst() throws IOException
     {
         throw new UnsupportedOperationException( "Cannot advance before first on the underlying
Iterator." );
@@ -119,7 +131,7 @@
     }
 
 
-    public Object get() throws IOException
+    public E get() throws IOException
     {
         checkClosed( "get()" );
         return current;

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/ListCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/ListCursor.java?rev=604375&r1=604374&r2=604375&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/ListCursor.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/ListCursor.java
Fri Dec 14 18:44:53 2007
@@ -19,6 +19,8 @@
 package org.apache.directory.server.core.cursor;
 
 
+import org.apache.directory.shared.ldap.NotImplementedException;
+
 import java.io.IOException;
 import java.util.Collections;
 import java.util.List;
@@ -31,7 +33,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class ListCursor<E> extends AbstractCursor
+public class ListCursor<E> extends AbstractCursor<E>
 {
     private final List<E> list;
     private final int start;
@@ -134,6 +136,18 @@
     {
         //noinspection unchecked
         this( 0, Collections.EMPTY_LIST, 0 );
+    }
+
+
+    public boolean before( E element ) throws IOException
+    {
+        throw new NotImplementedException();
+    }
+
+
+    public boolean after( E element ) throws IOException
+    {
+        throw new NotImplementedException();
     }
 
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/SingletonCursor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/SingletonCursor.java?rev=604375&r1=604374&r2=604375&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/SingletonCursor.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/core-shared/src/main/java/org/apache/directory/server/core/cursor/SingletonCursor.java
Fri Dec 14 18:44:53 2007
@@ -20,6 +20,7 @@
 
 
 import java.io.IOException;
+import java.util.Comparator;
 
 
 /**
@@ -28,17 +29,75 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class SingletonCursor<E> extends AbstractCursor
+public class SingletonCursor<E> extends AbstractCursor<E>
 {
     private boolean beforeFirst = true;
     private boolean afterLast;
     private boolean onSingleton;
+    private final Comparator<E> comparator;
     private final E singleton;
 
 
     public SingletonCursor( E singleton )
     {
+        this( singleton, null );
+    }
+
+
+    public SingletonCursor( E singleton, Comparator<E> comparator )
+    {
         this.singleton = singleton;
+        this.comparator = comparator;
+    }
+
+
+    public boolean before( E element ) throws IOException
+    {
+        checkClosed( "before()" );
+
+        if ( comparator == null )
+        {
+            throw new UnsupportedOperationException(
+                    "Without a comparator I cannot advance to just before the specified element."
);
+        }
+
+        int comparison = comparator.compare( singleton, element );
+
+        if ( comparison < 0 )
+        {
+            absolute( 0 );
+            return true;
+        }
+        else
+        {
+            beforeFirst();
+            return false;
+        }
+    }
+
+
+    public boolean after( E element ) throws IOException
+    {
+        checkClosed( "after()" );
+
+        if ( comparator == null )
+        {
+            throw new UnsupportedOperationException(
+                    "Without a comparator I cannot advance to just after the specified element."
);
+        }
+
+        int comparison = comparator.compare( singleton, element );
+
+        if ( comparison > 0 )
+        {
+            absolute( 0 );
+            return true;
+        }
+        else
+        {
+            afterLast();
+            return false;
+        }
     }
 
 

Added: directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/BTreeTupleCursor.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/BTreeTupleCursor.java?rev=604375&view=auto
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/BTreeTupleCursor.java
(added)
+++ directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/BTreeTupleCursor.java
Fri Dec 14 18:44:53 2007
@@ -0,0 +1,177 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.directory.server.core.partition.impl.btree.jdbm;
+
+
+import org.apache.directory.server.core.cursor.Cursor;
+import org.apache.directory.server.core.partition.impl.btree.Tuple;
+import org.apache.directory.server.core.partition.impl.btree.TupleBrowserFactory;
+import org.apache.directory.server.core.partition.impl.btree.TupleBrowser;
+import org.apache.directory.shared.ldap.NotImplementedException;
+
+import java.io.IOException;
+import java.util.Comparator;
+
+
+/**
+ * Document me!
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class BTreeTupleCursor implements Cursor
+{
+    private final Object key;
+    private final Tuple tuple = new Tuple();
+    private final TupleBrowserFactory factory;
+
+    private jdbm.helper.Tuple jdbmTuple = new jdbm.helper.Tuple();
+    private TupleBrowser browser;
+    private boolean success;
+
+
+
+    public BTreeTupleCursor( TupleBrowserFactory factory, Comparator<Object> comparator,
Object key, Object val,
+                             boolean beforeValue ) throws IOException
+    {
+        this.key = key;
+        this.factory = factory;
+
+        if ( beforeValue )
+        {
+            browser = factory.beforeKey( val );
+        }
+    }
+
+
+    /**
+     * @todo
+     *
+     * This is a little tricky. How do we know where we are positioned?  We could
+     * do some check perhaps with getNext() and backup with getPrevious().
+     *
+     * @param key
+     * @throws IOException
+     */
+    private void beforeKey( Object key ) throws IOException
+    {
+        browser = factory.beforeKey( key );
+        beforeFirst = false;
+        afterLast = false;
+        size = factory.size();
+        pos = BEFORE_FIRST;
+        success = true;
+
+        throw new NotImplementedException( "Need to fix the todo on this before going further"
);
+    }
+
+
+    public void beforeFirst() throws IOException
+    {
+    }
+
+
+    public void afterLast() throws IOException
+    {
+    }
+
+
+    public boolean absolute( int absolutePosition ) throws IOException
+    {
+        return false;
+    }
+
+
+    public boolean relative( int relativePosition ) throws IOException
+    {
+        return false;
+    }
+
+
+    public boolean first() throws IOException
+    {
+        return false;
+    }
+
+
+    public boolean last() throws IOException
+    {
+        return false;
+    }
+
+
+    public boolean isFirst() throws IOException
+    {
+        return false;
+    }
+
+
+    public boolean isLast() throws IOException
+    {
+        return false;
+    }
+
+
+    public boolean isAfterLast() throws IOException
+    {
+        return false;
+    }
+
+
+    public boolean isBeforeFirst() throws IOException
+    {
+        return false;
+    }
+
+
+    public boolean isClosed() throws IOException
+    {
+        return false;
+    }
+
+
+    public boolean previous() throws IOException
+    {
+        return false;
+    }
+
+
+    public boolean next() throws IOException
+    {
+        return false;
+    }
+
+
+    public Object get() throws IOException
+    {
+        return null;
+    }
+
+
+    public boolean isElementReused()
+    {
+        return false;
+    }
+
+
+    public void close() throws IOException
+    {
+
+    }
+}

Modified: directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/BTreeTupleEnumeration.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/BTreeTupleEnumeration.java?rev=604375&r1=604374&r2=604375&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/BTreeTupleEnumeration.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/BTreeTupleEnumeration.java
Fri Dec 14 18:44:53 2007
@@ -58,7 +58,7 @@
     private final jdbm.helper.Tuple jdbmTuple = new jdbm.helper.Tuple();
     private final boolean stepForward;
     private TupleBrowser browser;
-    private boolean success = false;
+    private boolean success;
     
     
     BTreeTupleEnumeration( BTree tree, Comparator<Object> comparator, Object key, Object
val, boolean isGreaterThan ) 

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=604375&r1=604374&r2=604375&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
Fri Dec 14 18:44:53 2007
@@ -147,11 +147,12 @@
             throw ne;
         }
 
+        
         browserFactory = new TupleBrowserFactory()
         {
             public long size() throws IOException
             {
-                return count;
+                return bt.size();
             }
 
 
@@ -165,6 +166,12 @@
             {
                 return new JdbmTupleBrowser( bt.browse( null ) );
             }
+
+
+            public org.apache.directory.server.core.partition.impl.btree.TupleBrowser beforeKey(
Object key ) throws IOException
+            {
+                return new JdbmTupleBrowser( bt.browse( key ) );
+            }
         };
     }
 
@@ -988,6 +995,7 @@
     // listTuple Overloads 
     // ------------------------------------------------------------------------
 
+    
     /**
      * @see org.apache.directory.server.core.partition.impl.btree.Table#listTuples()
      */
@@ -1055,13 +1063,10 @@
      */
     public Cursor<Tuple> listTuples( Object key, boolean isGreaterThan ) throws IOException
     {
-        Cursor<Tuple> list = null;
+        Cursor<Tuple> list;
 
         if ( isGreaterThan )
         {
-            // JdbmTupleBrowser browser = new JdbmTupleBrowser( bt.browse( key ) );
-            // list = new NoDupsEnumeration( browser, isGreaterThan );
-
             list = new NoDupsCursor( browserFactory, key );
         }
         else

Modified: directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTupleBrowser.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/JdbmTupleBrowser.java?rev=604375&r1=604374&r2=604375&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTupleBrowser.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTupleBrowser.java
Fri Dec 14 18:44:53 2007
@@ -22,8 +22,6 @@
 
 import java.io.IOException;
 
-import javax.naming.NamingException;
-
 import org.apache.directory.server.core.partition.impl.btree.Tuple;
 import org.apache.directory.server.core.partition.impl.btree.TupleBrowser;
 
@@ -39,7 +37,7 @@
     /** underlying wrapped jdbm.helper.TupleBrowser */
     private jdbm.helper.TupleBrowser jdbmBrowser;
     /** safe temp jdbm.helper.Tuple used to store next/previous tuples */
-    private jdbm.helper.Tuple jdbmTuple = new jdbm.helper.Tuple();
+    private final jdbm.helper.Tuple jdbmTuple = new jdbm.helper.Tuple();
 
 
     /**
@@ -56,22 +54,13 @@
     /**
      * @see TupleBrowser#getNext(org.apache.directory.server.core.partition.impl.btree.Tuple)
      */
-    public boolean getNext( Tuple tuple ) throws NamingException
+    public boolean getNext( Tuple tuple ) throws IOException
     {
-        boolean isSuccess = false;
+        boolean isSuccess;
 
         synchronized ( jdbmTuple )
         {
-            try
-            {
-                isSuccess = jdbmBrowser.getNext( jdbmTuple );
-            }
-            catch ( IOException ioe )
-            {
-                NamingException ne = new NamingException( "Failed on call to jdbm TupleBrowser.getNext()"
);
-                ne.setRootCause( ioe );
-                throw ne;
-            }
+            isSuccess = jdbmBrowser.getNext( jdbmTuple );
 
             if ( isSuccess )
             {
@@ -87,22 +76,13 @@
     /**
      * @see TupleBrowser#getPrevious(Tuple)
      */
-    public boolean getPrevious( Tuple tuple ) throws NamingException
+    public boolean getPrevious( Tuple tuple ) throws IOException
     {
-        boolean isSuccess = false;
+        boolean isSuccess;
 
         synchronized ( jdbmTuple )
         {
-            try
-            {
-                isSuccess = jdbmBrowser.getPrevious( jdbmTuple );
-            }
-            catch ( IOException ioe )
-            {
-                NamingException ne = new NamingException( "Failed on call to jdbm TupleBrowser.getPrevious()"
);
-                ne.setRootCause( ioe );
-                throw ne;
-            }
+            isSuccess = jdbmBrowser.getPrevious( jdbmTuple );
 
             if ( isSuccess )
             {



Mime
View raw message