directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r637695 - in /directory/sandbox/akarasulu/bigbang/apacheds: btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/ jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ jdbm-store/src/...
Date Mon, 17 Mar 2008 00:26:12 GMT
Author: akarasulu
Date: Sun Mar 16 17:26:10 2008
New Revision: 637695

URL: http://svn.apache.org/viewvc?rev=637695&view=rev
Log:
Index interface changes

Modified:
    directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/Index.java
    directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
    directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java
    directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java

Modified: directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/Index.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/Index.java?rev=637695&r1=637694&r2=637695&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/Index.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/btree-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/Index.java
Sun Mar 16 17:26:10 2008
@@ -180,10 +180,13 @@
     Cursor<IndexRecord> cursor() throws Exception;
 
 
-    boolean hasValue( K attrVal, Long id ) throws Exception;
+    boolean has( K attrVal, Long id ) throws Exception;
 
 
-    boolean hasValue( K attrVal, Long id, boolean isGreaterThan ) throws Exception;
+    boolean hasGreaterOrEqual( K attrVal, Long id ) throws Exception;
+
+
+    boolean hasLessOrEqual( K attrVal, Long id ) throws Exception;
 
 
     void close() throws Exception;

Modified: directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.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/JdbmIndex.java?rev=637695&r1=637694&r2=637695&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
Sun Mar 16 17:26:10 2008
@@ -478,27 +478,29 @@
 
     
     /**
-     * @see Index#hasValue(Object,Long)
+     * @see Index#has(Object,Long)
      */
-    public boolean hasValue( K attrVal, Long id ) throws Exception
+    public boolean has( K attrVal, Long id ) throws Exception
     {
         return forward.has( getNormalized( attrVal ), id );
     }
 
 
     /**
-     * @see Index#hasValue(Object, Long, boolean)
+     * @see Index#hasGreaterOrEqual(Object, Long)
      */
-    public boolean hasValue( K attrVal, Long id, boolean isGreaterThan ) throws Exception
+    public boolean hasGreaterOrEqual( K attrVal, Long id ) throws Exception
     {
-        if ( isGreaterThan )
-        {
-            return forward.hasGreaterOrEqual( getNormalized( attrVal ), id );
-        }
-        else
-        {
-            return forward.hasLessOrEqual( getNormalized( attrVal ), id );
-        }
+        return forward.hasGreaterOrEqual( getNormalized( attrVal ), id );
+    }
+
+
+    /**
+     * @see Index#hasLessOrEqual(Object, Long)
+     */
+    public boolean hasLessOrEqual( K attrVal, Long id ) throws Exception
+    {
+        return forward.hasLessOrEqual( getNormalized( attrVal ), id );
     }
 
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.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/JdbmStore.java?rev=637695&r1=637694&r2=637695&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java
Sun Mar 16 17:26:10 2008
@@ -1322,7 +1322,7 @@
             idx.add( mods, id );
 
             // If the attr didn't exist for this id add it to existance index
-            if ( !existanceIdx.hasValue( modsOid, id ) )
+            if ( !existanceIdx.has( modsOid, id ) )
             {
                 existanceIdx.add( modsOid, id );
             }
@@ -1627,7 +1627,7 @@
             idx.add( newRdnValue, id );
 
             // Make sure the altered entry shows the existance of the new attrib
-            if ( !existanceIdx.hasValue( newRdn.getNormType(), id ) )
+            if ( !existanceIdx.has( newRdn.getNormType(), id ) )
             {
                 existanceIdx.add( newRdn.getNormType(), id );
             }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.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/JdbmIndexTest.java?rev=637695&r1=637694&r2=637695&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java
Sun Mar 16 17:26:10 2008
@@ -23,7 +23,6 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.After;
-import org.junit.Ignore;
 import static org.junit.Assert.*;
 
 import org.apache.directory.server.schema.bootstrap.*;
@@ -371,8 +370,8 @@
 
         idx.drop( 0L );
         assertEquals( "foo", idx.reverseLookup( 1L ) );
-        assertFalse( idx.hasValue( "bar", 0L ) );
-        assertFalse( idx.hasValue( "foo", 0L ) );
+        assertFalse( idx.has( "bar", 0L ) );
+        assertFalse( idx.has( "foo", 0L ) );
 
         idx.drop( 1L );
         assertNull( idx.forwardLookup( "foo" ) );
@@ -414,12 +413,12 @@
         assertEquals( 0L, ( long ) idx.forwardLookup( "foo" ) );
         assertEquals( "foo", idx.reverseLookup( 0L ) );
         assertEquals( "foo", idx.reverseLookup( 1L ) );
-        assertFalse( idx.hasValue( "bar", 0L ) );
+        assertFalse( idx.has( "bar", 0L ) );
 
         idx.drop( "foo", 0L );
         assertEquals( 1L, ( long ) idx.forwardLookup( "foo" ) );
         assertEquals( "foo", idx.reverseLookup( 1L ) );
-        assertFalse( idx.hasValue( "foo", 0L ) );
+        assertFalse( idx.has( "foo", 0L ) );
 
         idx.drop( "foo", 1L );
         assertNull( idx.forwardLookup( "foo" ) );



Mime
View raw message