directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r437489 - in /directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree: TupleEnumeration.java jdbm/JdbmTable.java
Date Mon, 28 Aug 2006 00:53:08 GMT
Author: akarasulu
Date: Sun Aug 27 17:53:05 2006
New Revision: 437489

URL: http://svn.apache.org/viewvc?rev=437489&view=rev
Log:
Fix for DIRSERVER-624: Concurrency problem when doing load tests

Modified:
    directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/TupleEnumeration.java
    directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java

Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/TupleEnumeration.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/TupleEnumeration.java?rev=437489&r1=437488&r2=437489&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/TupleEnumeration.java
(original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/TupleEnumeration.java
Sun Aug 27 17:53:05 2006
@@ -50,7 +50,7 @@
      * @param key the keys whose duplicate values are to be returned
      * @param iterator the underlying iterator this cursor uses
      */
-    public TupleEnumeration(Object key, Iterator iterator)
+    public TupleEnumeration( Object key, Iterator iterator )
     {
         this.key = key;
         tuple.setKey( key );

Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java?rev=437489&r1=437488&r2=437489&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
(original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
Sun Aug 27 17:53:05 2006
@@ -34,6 +34,7 @@
 import jdbm.btree.BTree;
 import jdbm.helper.TupleBrowser;
 
+import org.apache.commons.collections.iterators.ArrayIterator;
 import org.apache.directory.server.core.partition.impl.btree.DupsEnumeration;
 import org.apache.directory.server.core.partition.impl.btree.KeyOnlyComparator;
 import org.apache.directory.server.core.partition.impl.btree.NoDupsEnumeration;
@@ -843,7 +844,10 @@
             return new EmptyEnumeration();
         }
 
-        return new TupleEnumeration( key, set.iterator() );
+        Object[] objs = new Object[set.size()];
+        objs = set.toArray( objs );
+        ArrayIterator iterator = new ArrayIterator( objs );
+        return new TupleEnumeration( key, iterator );
     }
 
 
@@ -951,7 +955,10 @@
 
         if ( isGreaterThan )
         {
-            return new TupleEnumeration( key, set.tailSet( val ).iterator() );
+            Object[] objs = new Object[set.size()];
+            objs = set.tailSet( val ).toArray( objs );
+            ArrayIterator iterator = new ArrayIterator( objs );
+            return new TupleEnumeration( key, iterator );
         }
         else
         {



Mime
View raw message