directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1379396 - in /directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src: main/java/org/apache/directory/server/core/partition/impl/btree/ main/java/org/apache/directory/server/xdbm/ test/java/org/apache/directory/server/xdbm/
Date Fri, 31 Aug 2012 10:09:38 GMT
Author: elecharny
Date: Fri Aug 31 10:09:37 2012
New Revision: 1379396

URL: http://svn.apache.org/viewvc?rev=1379396&view=rev
Log:
o Removed the Entry parameter from the IndexEntry.setTuple() : it's never used
o Removed the ENtry parameter from the AbstractIndexEntry() constructor : it's never used

Modified:
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexCursorAdaptor.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexEnumeration.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractIndexEntry.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/ForwardIndexEntry.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/IndexEntry.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/ReverseIndexEntry.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/ForwardIndexEntryTest.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/ReverseIndexEntryTest.java

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexCursorAdaptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexCursorAdaptor.java?rev=1379396&r1=1379395&r2=1379396&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexCursorAdaptor.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexCursorAdaptor.java
Fri Aug 31 10:09:37 2012
@@ -73,6 +73,7 @@ public class IndexCursorAdaptor<K> exten
         }
         else
         {
+            System.out.println( "~~~~~~~~~~~~~~~~> Using the reverse index !!!" );
             forwardEntry = null;
             reverseEntry = new ReverseIndexEntry<K, String>();
         }
@@ -145,13 +146,13 @@ public class IndexCursorAdaptor<K> exten
         if ( forwardEntry != null )
         {
             Tuple<K, String> tuple = wrappedCursor.get();
-            forwardEntry.setTuple( tuple, null );
+            forwardEntry.setTuple( tuple );
             return forwardEntry;
         }
         else
         {
             Tuple<String, K> tuple = wrappedCursor.get();
-            reverseEntry.setTuple( tuple, null );
+            reverseEntry.setTuple( tuple );
             return reverseEntry;
         }
     }

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexEnumeration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexEnumeration.java?rev=1379396&r1=1379395&r2=1379396&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexEnumeration.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexEnumeration.java
Fri Aug 31 10:09:37 2012
@@ -20,17 +20,17 @@
 package org.apache.directory.server.core.partition.impl.btree;
 
 
-import org.apache.directory.shared.util.exception.NotImplementedException;
-import org.apache.directory.shared.ldap.model.cursor.Tuple;
-import org.apache.directory.server.xdbm.ForwardIndexEntry;
-import org.apache.directory.server.xdbm.IndexEntry;
-
 import java.util.NoSuchElementException;
 import java.util.regex.Pattern;
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 
+import org.apache.directory.server.xdbm.ForwardIndexEntry;
+import org.apache.directory.server.xdbm.IndexEntry;
+import org.apache.directory.shared.ldap.model.cursor.Tuple;
+import org.apache.directory.shared.util.exception.NotImplementedException;
+
 
 /**
  * A NamingEnumeration over an Index which returns IndexRecords.
@@ -164,7 +164,7 @@ public class IndexEnumeration<T> impleme
             }
             else
             {
-                tmp.setTuple( tuple, null );
+                tmp.setTuple( tuple );
             }
 
             // If regex is null just transfer into prefetched from tmp record

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractIndexEntry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractIndexEntry.java?rev=1379396&r1=1379395&r2=1379396&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractIndexEntry.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractIndexEntry.java
Fri Aug 31 10:09:37 2012
@@ -39,12 +39,10 @@ public abstract class AbstractIndexEntry
 
     /**
      * Creates an instance of AbstractIndexEntry
-     * 
-     * @param object The interned Entry
      */
-    protected AbstractIndexEntry( Entry entry )
+    protected AbstractIndexEntry()
     {
-        this.entry = entry;
+        this.entry = null;
     }
 
 

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/ForwardIndexEntry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/ForwardIndexEntry.java?rev=1379396&r1=1379395&r2=1379396&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/ForwardIndexEntry.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/ForwardIndexEntry.java
Fri Aug 31 10:09:37 2012
@@ -21,7 +21,6 @@ package org.apache.directory.server.xdbm
 
 
 import org.apache.directory.shared.ldap.model.cursor.Tuple;
-import org.apache.directory.shared.ldap.model.entry.Entry;
 
 
 /**
@@ -43,21 +42,22 @@ public class ForwardIndexEntry<K, ID> ex
      */
     public ForwardIndexEntry()
     {
-        super( null );
+        super();
     }
 
 
     /**
-     * Sets the key value tuple represented by this ForwardIndexEntry optionally
-     * setting the Entry associated with the id if one was loaded from the
-     * master table.
+     * Sets the key value tuple represented by this ForwardIndexEntry, after having 
+     * reset the IndexEntry content (the Entry will now be null)
      *
      * @param tuple the tuple for the ForwardIndexEntry
-     * @param entry the resuscitated Entry if any
      */
-    public void setTuple( Tuple<K, ID> tuple, Entry entry )
+    public void setTuple( Tuple<K, ID> tuple )
     {
-        setEntry( entry );
+        // Clear the entry
+        super.clear();
+
+        // And inject the tuple key and value 
         this.tuple.setKey( tuple.getKey() );
         this.tuple.setValue( tuple.getValue() );
     }

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/IndexEntry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/IndexEntry.java?rev=1379396&r1=1379395&r2=1379396&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/IndexEntry.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/IndexEntry.java
Fri Aug 31 10:09:37 2012
@@ -25,9 +25,11 @@ import org.apache.directory.shared.ldap.
 
 
 /**
- * Interface for index entries. An index entry associate an Entry with 
- * a key and the Entry ID in the table where it's stored. The Entry
- * may be present in this instance once we read it from the table.
+ * Interface for index entries.
+ * <br/> 
+ * An index entry associate an Entry with the key that was used to find it,
+ * and the Entry UUID in the masterTable where it's stored. The Entry
+ * may be present in this instance once we read it from the masterTable.<p/>
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @param <V> The value stored in the Tuple, associated key for the object

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/ReverseIndexEntry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/ReverseIndexEntry.java?rev=1379396&r1=1379395&r2=1379396&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/ReverseIndexEntry.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/ReverseIndexEntry.java
Fri Aug 31 10:09:37 2012
@@ -21,7 +21,6 @@ package org.apache.directory.server.xdbm
 
 
 import org.apache.directory.shared.ldap.model.cursor.Tuple;
-import org.apache.directory.shared.ldap.model.entry.Entry;
 
 
 /**
@@ -43,21 +42,22 @@ public class ReverseIndexEntry<K, ID> ex
      */
     public ReverseIndexEntry()
     {
-        super( null );
+        super();
     }
 
 
     /**
-     * Sets the Tuple value represented by this ReverseIndexEntry optionally
-     * setting the Entry associated with the id if one was loaded from the
-     * master table.
+     * Sets the Tuple value represented by this ReverseIndexEntry, after having 
+     * reset the IndexEntry content (the Entry will now be null)
      *
      * @param tuple the tuple for the ReverseIndexEntry
-     * @param obj the resusitated Entry that is indexed if any
      */
-    public void setTuple( Tuple<ID, K> tuple, Entry entry )
+    public void setTuple( Tuple<ID, K> tuple )
     {
-        setEntry( entry );
+        // Clear the entry
+        super.clear();
+
+        // And inject the tuple key and value 
         this.tuple.setKey( tuple.getKey() );
         this.tuple.setValue( tuple.getValue() );
     }
@@ -102,7 +102,7 @@ public class ReverseIndexEntry<K, ID> ex
     /**
      * {@inheritDoc}
      */
-    public Tuple<?, ?> getTuple()
+    public Tuple<ID, K> getTuple()
     {
         return tuple;
     }

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/ForwardIndexEntryTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/ForwardIndexEntryTest.java?rev=1379396&r1=1379395&r2=1379396&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/ForwardIndexEntryTest.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/ForwardIndexEntryTest.java
Fri Aug 31 10:09:37 2012
@@ -86,16 +86,15 @@ public class ForwardIndexEntryTest
         assertNull( indexEntry.getTuple().getKey() );
         assertNull( indexEntry.getTuple().getKey() );
 
-        indexEntry.setTuple( new Tuple<String, Long>( "a", 1L ), new DefaultEntry()
);
+        indexEntry.setTuple( new Tuple<String, Long>( "a", 1L ) );
         assertEquals( new Tuple<String, Long>( "a", 1L ), indexEntry.getTuple() );
-        assertEquals( new DefaultEntry(), indexEntry.getEntry() );
     }
 
 
     @Test
     public void testClear()
     {
-        indexEntry.setTuple( new Tuple<String, Long>( "a", 1L ), new DefaultEntry()
);
+        indexEntry.setTuple( new Tuple<String, Long>( "a", 1L ) );
         indexEntry.clear();
 
         assertNull( indexEntry.getId() );
@@ -111,7 +110,7 @@ public class ForwardIndexEntryTest
     public void testCopy()
     {
         // prepare index entry
-        indexEntry.setTuple( new Tuple<String, Long>( "a", 1L ), new DefaultEntry()
);
+        indexEntry.setTuple( new Tuple<String, Long>( "a", 1L ) );
 
         // create empty index entry and assert empty values
         ForwardIndexEntry<String, Long> indexEntry2 = new ForwardIndexEntry<String,
Long>();
@@ -126,7 +125,6 @@ public class ForwardIndexEntryTest
         indexEntry2.copy( indexEntry );
         assertEquals( Long.valueOf( 1L ), indexEntry2.getId() );
         assertEquals( "a", indexEntry2.getKey() );
-        assertEquals( new DefaultEntry(), indexEntry2.getEntry() );
         assertEquals( new Tuple<String, Long>( "a", 1L ), indexEntry2.getTuple() );
     }
 
@@ -134,7 +132,7 @@ public class ForwardIndexEntryTest
     @Test
     public void testToString()
     {
-        indexEntry.setTuple( new Tuple<String, Long>( "asdfghjkl", 1234567890L ), new
DefaultEntry() );
+        indexEntry.setTuple( new Tuple<String, Long>( "asdfghjkl", 1234567890L ) );
         assertTrue( indexEntry.toString().contains( "asdfghjkl" ) );
         assertTrue( indexEntry.toString().contains( "1234567890" ) );
     }

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/ReverseIndexEntryTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/ReverseIndexEntryTest.java?rev=1379396&r1=1379395&r2=1379396&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/ReverseIndexEntryTest.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/ReverseIndexEntryTest.java
Fri Aug 31 10:09:37 2012
@@ -86,16 +86,15 @@ public class ReverseIndexEntryTest
         assertNull( indexEntry.getTuple().getKey() );
         assertNull( indexEntry.getTuple().getValue() );
 
-        indexEntry.setTuple( new Tuple<Long, String>( 1L, "a" ), new DefaultEntry()
);
+        indexEntry.setTuple( new Tuple<Long, String>( 1L, "a" ) );
         assertEquals( new Tuple<Long, String>( 1L, "a" ), indexEntry.getTuple() );
-        assertEquals( new DefaultEntry(), indexEntry.getEntry() );
     }
 
 
     @Test
     public void testClear()
     {
-        indexEntry.setTuple( new Tuple<Long, String>( 1L, "a" ), new DefaultEntry()
);
+        indexEntry.setTuple( new Tuple<Long, String>( 1L, "a" ) );
         indexEntry.clear();
 
         assertNull( indexEntry.getId() );
@@ -111,7 +110,7 @@ public class ReverseIndexEntryTest
     public void testCopy()
     {
         // prepare index entry
-        indexEntry.setTuple( new Tuple<Long, String>( 1L, "a" ), new DefaultEntry()
);
+        indexEntry.setTuple( new Tuple<Long, String>( 1L, "a" ) );
 
         // create empty index entry and assert empty values
         ReverseIndexEntry<String, Long> indexEntry2 = new ReverseIndexEntry<String,
Long>();
@@ -126,7 +125,6 @@ public class ReverseIndexEntryTest
         indexEntry2.copy( indexEntry );
         assertEquals( Long.valueOf( 1L ), indexEntry2.getId() );
         assertEquals( "a", indexEntry2.getKey() );
-        assertEquals( new DefaultEntry(), indexEntry2.getEntry() );
         assertEquals( new Tuple<Long, String>( 1L, "a" ), indexEntry2.getTuple() );
     }
 
@@ -134,7 +132,7 @@ public class ReverseIndexEntryTest
     @Test
     public void testToString()
     {
-        indexEntry.setTuple( new Tuple<Long, String>( 1234567890L, "asdfghjkl" ), new
DefaultEntry() );
+        indexEntry.setTuple( new Tuple<Long, String>( 1234567890L, "asdfghjkl" ) );
         assertTrue( indexEntry.toString().contains( "asdfghjkl" ) );
         assertTrue( indexEntry.toString().contains( "1234567890" ) );
     }



Mime
View raw message