directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1376549 - in /directory/apacheds/branches/apacheds-mvbt: jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ xdbm...
Date Thu, 23 Aug 2012 15:31:16 GMT
Author: elecharny
Date: Thu Aug 23 15:31:15 2012
New Revision: 1376549

URL: http://svn.apache.org/viewvc?rev=1376549&view=rev
Log:
o Removed the JdbmInde( name ) constructor
o emove the generic for JdbmRdnIndex and AvlRdnIndex

Modified:
    directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
    directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndex.java
    directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndexTest.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/avl/AvlPartition.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndex.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndexTest.java

Modified: directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java?rev=1376549&r1=1376548&r2=1376549&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
Thu Aug 23 15:31:15 2012
@@ -52,7 +52,7 @@ import org.slf4j.LoggerFactory;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class JdbmIndex<K, O> extends AbstractIndex<K, O, Long>
+public class JdbmIndex<K, V> extends AbstractIndex<K, V, Long>
 {
     /** A logger for this class */
     private static final Logger LOG = LoggerFactory.getLogger( JdbmIndex.class.getSimpleName()
);
@@ -120,16 +120,6 @@ public class JdbmIndex<K, O> extends Abs
     /**
      * Creates a JdbmIndex instance for a give AttributeId
      */
-    public JdbmIndex( String attributeId )
-    {
-        this( attributeId, true );
-        initialized = false;
-    }
-
-
-    /**
-     * Creates a JdbmIndex instance for a give AttributeId
-     */
     public JdbmIndex( String attributeId, boolean withReverse )
     {
         super( attributeId, withReverse );
@@ -439,44 +429,44 @@ public class JdbmIndex<K, O> extends Abs
     // Index Cursor Operations
     // ------------------------------------------------------------------------
     @SuppressWarnings("unchecked")
-    public IndexCursor<K, O, Long> reverseCursor() throws Exception
+    public IndexCursor<K, V, Long> reverseCursor() throws Exception
     {
         if ( withReverse )
         {
-            return new IndexCursorAdaptor<K, O, Long>( ( Cursor ) reverse.cursor(),
false );
+            return new IndexCursorAdaptor<K, V, Long>( ( Cursor ) reverse.cursor(),
false );
         }
         else
         {
-            return new EmptyIndexCursor<K, O, Long>();
+            return new EmptyIndexCursor<K, V, Long>();
         }
     }
 
 
     @SuppressWarnings("unchecked")
-    public IndexCursor<K, O, Long> forwardCursor() throws Exception
+    public IndexCursor<K, V, Long> forwardCursor() throws Exception
     {
-        return new IndexCursorAdaptor<K, O, Long>( ( Cursor ) forward.cursor(), true
);
+        return new IndexCursorAdaptor<K, V, Long>( ( Cursor ) forward.cursor(), true
);
     }
 
 
     @SuppressWarnings("unchecked")
-    public IndexCursor<K, O, Long> reverseCursor( Long id ) throws Exception
+    public IndexCursor<K, V, Long> reverseCursor( Long id ) throws Exception
     {
         if ( withReverse )
         {
-            return new IndexCursorAdaptor<K, O, Long>( ( Cursor ) reverse.cursor( id
), false );
+            return new IndexCursorAdaptor<K, V, Long>( ( Cursor ) reverse.cursor( id
), false );
         }
         else
         {
-            return new EmptyIndexCursor<K, O, Long>();
+            return new EmptyIndexCursor<K, V, Long>();
         }
     }
 
 
     @SuppressWarnings("unchecked")
-    public IndexCursor<K, O, Long> forwardCursor( K key ) throws Exception
+    public IndexCursor<K, V, Long> forwardCursor( K key ) throws Exception
     {
-        return new IndexCursorAdaptor<K, O, Long>( ( Cursor ) forward.cursor( key ),
true );
+        return new IndexCursorAdaptor<K, V, Long>( ( Cursor ) forward.cursor( key ),
true );
     }
 
 

Modified: directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndex.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndex.java?rev=1376549&r1=1376548&r2=1376549&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndex.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndex.java
Thu Aug 23 15:31:15 2012
@@ -35,6 +35,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.xdbm.ParentIdAndRdn;
 import org.apache.directory.server.xdbm.ParentIdAndRdnComparator;
+import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 import org.apache.directory.shared.ldap.model.schema.MatchingRule;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
@@ -47,7 +48,7 @@ import org.slf4j.LoggerFactory;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class JdbmRdnIndex<E> extends JdbmIndex<ParentIdAndRdn<Long>, E>
+public class JdbmRdnIndex extends JdbmIndex<ParentIdAndRdn<Long>, Entry>
 {
 
     /** A logger for this class */

Modified: directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndexTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndexTest.java?rev=1376549&r1=1376548&r2=1376549&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndexTest.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndexTest.java
Thu Aug 23 15:31:15 2012
@@ -34,6 +34,7 @@ import org.apache.directory.server.xdbm.
 import org.apache.directory.server.xdbm.IndexEntry;
 import org.apache.directory.server.xdbm.ParentIdAndRdn;
 import org.apache.directory.shared.ldap.model.cursor.Cursor;
+import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.name.Rdn;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schemaextractor.SchemaLdifExtractor;
@@ -55,7 +56,7 @@ import org.junit.Test;
 public class JdbmRdnIndexTest
 {
     private static File dbFileDir;
-    Index<ParentIdAndRdn<Long>, Long, Long> idx;
+    Index<ParentIdAndRdn<Long>, Entry, Long> idx;
     private static SchemaManager schemaManager;
 
 
@@ -136,17 +137,17 @@ public class JdbmRdnIndexTest
 
     void initIndex() throws Exception
     {
-        JdbmRdnIndex<Long> index = new JdbmRdnIndex<Long>();
+        JdbmRdnIndex index = new JdbmRdnIndex();
         index.setWkDirPath( dbFileDir.toURI() );
         initIndex( index );
     }
 
 
-    void initIndex( JdbmRdnIndex<Long> jdbmIdx ) throws Exception
+    void initIndex( JdbmRdnIndex jdbmIdx ) throws Exception
     {
         if ( jdbmIdx == null )
         {
-            jdbmIdx = new JdbmRdnIndex<Long>();
+            jdbmIdx = new JdbmRdnIndex();
         }
 
         jdbmIdx.init( schemaManager,
@@ -163,7 +164,7 @@ public class JdbmRdnIndexTest
     public void testCacheSize() throws Exception
     {
         // uninitialized index
-        JdbmRdnIndex<Object> JdbmRdnIndex = new JdbmRdnIndex<Object>();
+        JdbmRdnIndex JdbmRdnIndex = new JdbmRdnIndex();
         JdbmRdnIndex.setCacheSize( 337 );
         assertEquals( 337, JdbmRdnIndex.getCacheSize() );
 
@@ -191,7 +192,7 @@ public class JdbmRdnIndexTest
         File wkdir = new File( dbFileDir, "foo" );
 
         // uninitialized index
-        JdbmRdnIndex<Long> jdbmRdnIndex = new JdbmRdnIndex<Long>();
+        JdbmRdnIndex jdbmRdnIndex = new JdbmRdnIndex();
         jdbmRdnIndex.setWkDirPath( wkdir.toURI() );
         assertEquals( "foo", new File( jdbmRdnIndex.getWkDirPath() ).getName() );
 
@@ -211,7 +212,7 @@ public class JdbmRdnIndexTest
 
         destroyIndex();
 
-        jdbmRdnIndex = new JdbmRdnIndex<Long>();
+        jdbmRdnIndex = new JdbmRdnIndex();
         wkdir.mkdirs();
         jdbmRdnIndex.setWkDirPath( wkdir.toURI() );
         initIndex( jdbmRdnIndex );
@@ -223,7 +224,7 @@ public class JdbmRdnIndexTest
     public void testGetAttribute() throws Exception
     {
         // uninitialized index
-        JdbmRdnIndex<Object> rdnIndex = new JdbmRdnIndex<Object>();
+        JdbmRdnIndex rdnIndex = new JdbmRdnIndex();
         assertNull( rdnIndex.getAttribute() );
 
         initIndex();
@@ -341,7 +342,7 @@ public class JdbmRdnIndexTest
         {
             key = new ParentIdAndRdn<Long>( i, new Rdn( "cn=key" + i ) );
 
-            idx.add( key, ( long ) i );
+            idx.add( key, i );
         }
 
         assertEquals( 5, idx.count() );
@@ -367,7 +368,7 @@ public class JdbmRdnIndexTest
         assertEquals( 2, ( long ) e3.getId() );
         assertEquals( "cn=key2", e3.getKey().getRdns()[0].getName() );
         assertEquals( 2, e3.getKey().getParentId().longValue() );
-        
+
         cursor.close();
     }
 

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/avl/AvlPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/avl/AvlPartition.java?rev=1376549&r1=1376548&r2=1376549&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/avl/AvlPartition.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/avl/AvlPartition.java
Thu Aug 23 15:31:15 2012
@@ -149,7 +149,7 @@ public class AvlPartition extends Abstra
 
         if ( index.getAttributeId().equals( ApacheSchemaConstants.APACHE_RDN_AT_OID ) )
         {
-            avlIndex = new AvlRdnIndex<Entry>( index.getAttributeId() );
+            avlIndex = new AvlRdnIndex( index.getAttributeId() );
         }
         else if ( index instanceof AvlIndex<?, ?> )
         {
@@ -167,7 +167,7 @@ public class AvlPartition extends Abstra
         return avlIndex;
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -176,11 +176,11 @@ public class AvlPartition extends Abstra
         LOG.debug( "Supplied index {} is not a JdbmIndex.  "
             + "Will create new JdbmIndex using copied configuration parameters." );
 
-        AvlIndex<?, Entry>  avlIndex;
+        AvlIndex<?, Entry> avlIndex;
 
         if ( oid.equals( ApacheSchemaConstants.APACHE_RDN_AT_OID ) )
         {
-            avlIndex = new AvlRdnIndex<Entry>( oid );
+            avlIndex = new AvlRdnIndex( oid );
         }
         else
         {

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndex.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndex.java?rev=1376549&r1=1376548&r2=1376549&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndex.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndex.java
Thu Aug 23 15:31:15 2012
@@ -25,6 +25,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.xdbm.ParentIdAndRdn;
 import org.apache.directory.server.xdbm.ParentIdAndRdnComparator;
+import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 import org.apache.directory.shared.ldap.model.schema.MatchingRule;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
@@ -35,7 +36,7 @@ import org.apache.directory.shared.ldap.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class AvlRdnIndex<E> extends AvlIndex<ParentIdAndRdn<Long>, E>
+public class AvlRdnIndex extends AvlIndex<ParentIdAndRdn<Long>, Entry>
 {
     public AvlRdnIndex()
     {

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndexTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndexTest.java?rev=1376549&r1=1376548&r2=1376549&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndexTest.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndexTest.java
Thu Aug 23 15:31:15 2012
@@ -33,6 +33,7 @@ import org.apache.directory.server.xdbm.
 import org.apache.directory.server.xdbm.IndexEntry;
 import org.apache.directory.server.xdbm.ParentIdAndRdn;
 import org.apache.directory.shared.ldap.model.cursor.Cursor;
+import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.name.Rdn;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schemaextractor.SchemaLdifExtractor;
@@ -55,7 +56,7 @@ import org.junit.Test;
 public class AvlRdnIndexTest
 {
     private static File dbFileDir;
-    Index<ParentIdAndRdn<Long>, Long, Long> idx;
+    Index<ParentIdAndRdn<Long>, Entry, Long> idx;
     private static SchemaManager schemaManager;
 
 
@@ -279,7 +280,7 @@ public class AvlRdnIndexTest
         {
             key = new ParentIdAndRdn<Long>( i, new Rdn( "cn=key" + i ) );
 
-            idx.add( key, ( long ) i );
+            idx.add( key, i );
         }
 
         assertEquals( 5, idx.count() );



Mime
View raw message