You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2013/11/09 15:52:38 UTC
svn commit: r1540320 - in /directory/apacheds/trunk:
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-partition/src/ma...
Author: elecharny
Date: Sat Nov 9 14:52:37 2013
New Revision: 1540320
URL: http://svn.apache.org/r1540320
Log:
o Removed the forwardGreaterOrEq, forwardLessOrEq, reverseGreaterOrEq, and reverseLessOrEq methods, they are useless and never used anyway.
Modified:
directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java
directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractTable.java
directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Index.java
directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Table.java
directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlIndex.java
directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/GreaterEqEvaluator.java
Modified: directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java?rev=1540320&r1=1540319&r2=1540320&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java (original)
+++ directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java Sat Nov 9 14:52:37 2013
@@ -551,106 +551,6 @@ public class JdbmIndex<K> extends Abstra
}
- /**
- * {@inheritDoc}
- */
- public boolean forwardGreaterOrEq( K attrVal ) throws Exception
- {
- return forward.hasGreaterOrEqual( attrVal );
- }
-
-
- /**
- * {@inheritDoc}
- */
- public boolean forwardGreaterOrEq( K attrVal, String id ) throws Exception
- {
- return forward.hasGreaterOrEqual( attrVal, id );
- }
-
-
- /**
- * {@inheritDoc}
- */
- public boolean forwardLessOrEq( K attrVal ) throws Exception
- {
- return forward.hasLessOrEqual( attrVal );
- }
-
-
- /**
- * {@inheritDoc}
- */
- public boolean forwardLessOrEq( K attrVal, String id ) throws Exception
- {
- return forward.hasLessOrEqual( attrVal, id );
- }
-
-
- /**
- * {@inheritDoc}
- */
- public boolean reverseGreaterOrEq( String id ) throws Exception
- {
- if ( withReverse )
- {
- return reverse.hasGreaterOrEqual( id );
- }
- else
- {
- return false;
- }
- }
-
-
- /**
- * {@inheritDoc}
- */
- public boolean reverseGreaterOrEq( String id, K attrVal ) throws LdapException
- {
- if ( withReverse )
- {
- return reverse.hasGreaterOrEqual( id, attrVal );
- }
- else
- {
- return false;
- }
- }
-
-
- /**
- * {@inheritDoc}
- */
- public boolean reverseLessOrEq( String id ) throws Exception
- {
- if ( withReverse )
- {
- return reverse.hasLessOrEqual( id );
- }
- else
- {
- return false;
- }
- }
-
-
- /**
- * {@inheritDoc}
- */
- public boolean reverseLessOrEq( String id, K attrVal ) throws Exception
- {
- if ( withReverse )
- {
- return reverse.hasLessOrEqual( id, attrVal );
- }
- else
- {
- return false;
- }
- }
-
-
// ------------------------------------------------------------------------
// Maintenance Methods
// ------------------------------------------------------------------------
Modified: directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java?rev=1540320&r1=1540319&r2=1540320&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java (original)
+++ directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndexTest.java Sat Nov 9 14:52:37 2013
@@ -367,53 +367,21 @@ public class JdbmIndexTest
initIndex();
assertNull( idx.forwardLookup( "foo" ) );
assertNull( idx.forwardLookup( "bar" ) );
- assertFalse( idx.forwardGreaterOrEq( "foo", Strings.getUUID( 0L ) ) );
- assertFalse( idx.forwardGreaterOrEq( "foo", Strings.getUUID( -24L ) ) );
- assertFalse( idx.forwardGreaterOrEq( "foo", Strings.getUUID( 24L ) ) );
- assertFalse( idx.forwardLessOrEq( "foo", Strings.getUUID( 0L ) ) );
- assertFalse( idx.forwardLessOrEq( "foo", Strings.getUUID( 24L ) ) );
- assertFalse( idx.forwardLessOrEq( "foo", Strings.getUUID( -24L ) ) );
idx.add( "foo", Strings.getUUID( 0L ) );
assertEquals( Strings.getUUID( 0L ), idx.forwardLookup( "foo" ) );
assertTrue( idx.forward( "foo", Strings.getUUID( 0L ) ) );
- assertTrue( idx.forwardGreaterOrEq( "foo", Strings.getUUID( 0L ) ) );
- assertFalse( idx.forwardGreaterOrEq( "foo", Strings.getUUID( -1L ) ) );
- assertFalse( idx.forwardGreaterOrEq( "foo", Strings.getUUID( 1L ) ) );
- assertTrue( idx.forwardLessOrEq( "foo", Strings.getUUID( 0L ) ) );
- assertTrue( idx.forwardLessOrEq( "foo", Strings.getUUID( 1L ) ) );
- assertTrue( idx.forwardLessOrEq( "foo", Strings.getUUID( -1L ) ) );
idx.add( "foo", Strings.getUUID( 1L ) );
assertEquals( Strings.getUUID( 0L ), idx.forwardLookup( "foo" ) );
assertTrue( idx.forward( "foo", Strings.getUUID( 0L ) ) );
assertTrue( idx.forward( "foo", Strings.getUUID( 1L ) ) );
- assertTrue( idx.forwardGreaterOrEq( "foo", Strings.getUUID( 0L ) ) );
- assertTrue( idx.forwardGreaterOrEq( "foo", Strings.getUUID( 1L ) ) );
- assertFalse( idx.forwardGreaterOrEq( "foo", Strings.getUUID( -1L ) ) );
- assertFalse( idx.forwardGreaterOrEq( "foo", Strings.getUUID( 2L ) ) );
- assertTrue( idx.forwardLessOrEq( "foo", Strings.getUUID( 0L ) ) );
- assertTrue( idx.forwardLessOrEq( "foo", Strings.getUUID( 1L ) ) );
- assertTrue( idx.forwardLessOrEq( "foo", Strings.getUUID( 2L ) ) );
- assertTrue( idx.forwardLessOrEq( "foo", Strings.getUUID( -1L ) ) );
idx.add( "bar", Strings.getUUID( 0L ) );
assertEquals( Strings.getUUID( 0L ), idx.forwardLookup( "bar" ) );
assertTrue( idx.forward( "bar", Strings.getUUID( 0L ) ) );
assertTrue( idx.forward( "foo", Strings.getUUID( 0L ) ) );
assertTrue( idx.forward( "foo", Strings.getUUID( 1L ) ) );
- assertTrue( idx.forwardGreaterOrEq( "bar", Strings.getUUID( 0L ) ) );
- assertTrue( idx.forwardGreaterOrEq( "foo", Strings.getUUID( 0L ) ) );
- assertTrue( idx.forwardGreaterOrEq( "foo", Strings.getUUID( 1L ) ) );
- assertFalse( idx.forwardGreaterOrEq( "foo", Strings.getUUID( -1L ) ) );
- assertFalse( idx.forwardGreaterOrEq( "foo", Strings.getUUID( 2L ) ) );
- assertFalse( idx.forwardGreaterOrEq( "bar", Strings.getUUID( 1L ) ) );
- assertTrue( idx.forwardLessOrEq( "bar", Strings.getUUID( 0L ) ) );
- assertTrue( idx.forwardLessOrEq( "foo", Strings.getUUID( 0L ) ) );
- assertTrue( idx.forwardLessOrEq( "foo", Strings.getUUID( 1L ) ) );
- assertTrue( idx.forwardLessOrEq( "foo", Strings.getUUID( 2L ) ) );
- assertTrue( idx.forwardLessOrEq( "foo", Strings.getUUID( -1L ) ) );
- assertTrue( idx.forwardLessOrEq( "bar", Strings.getUUID( -1L ) ) );
}
Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractTable.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractTable.java?rev=1540320&r1=1540319&r2=1540320&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractTable.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractTable.java Sat Nov 9 14:52:37 2013
@@ -50,7 +50,7 @@ public abstract class AbstractTable<K, V
/** a value comparator for the values in this Table */
protected final Comparator<V> valueComparator;
- /** the current count of entries in this Table */
+ /** the current count of Tuples in this Table */
protected long count;
/** whether or not this table allows for duplicates */
Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Index.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Index.java?rev=1540320&r1=1540319&r2=1540320&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Index.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Index.java Sat Nov 9 14:52:37 2013
@@ -225,30 +225,6 @@ public interface Index<K, ID>
boolean reverse( ID id, K attrVal ) throws Exception;
- boolean forwardGreaterOrEq( K attrVal ) throws Exception;
-
-
- boolean forwardGreaterOrEq( K attrVal, ID id ) throws Exception;
-
-
- boolean reverseGreaterOrEq( ID id ) throws Exception;
-
-
- boolean reverseGreaterOrEq( ID id, K attrVal ) throws LdapException;
-
-
- boolean forwardLessOrEq( K attrVal ) throws Exception;
-
-
- boolean forwardLessOrEq( K attrVal, ID id ) throws Exception;
-
-
- boolean reverseLessOrEq( ID id ) throws Exception;
-
-
- boolean reverseLessOrEq( ID id, K attrVal ) throws Exception;
-
-
void close() throws Exception;
Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Table.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Table.java?rev=1540320&r1=1540319&r2=1540320&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Table.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Table.java Sat Nov 9 14:52:37 2013
@@ -273,7 +273,7 @@ public interface Table<K, V>
// ------------------------------------------------------------------------
/**
- * Gets the count of the number of records in this Table.
+ * Gets the count of the number of Tuples in this Table.
*
* @return the number of records
* @throws Exception if there is a failure to read the underlying Db
Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlIndex.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlIndex.java?rev=1540320&r1=1540319&r2=1540320&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlIndex.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlIndex.java Sat Nov 9 14:52:37 2013
@@ -253,42 +253,6 @@ public class AvlIndex<K> extends Abstrac
/**
* {@inheritDoc}
*/
- public boolean forwardGreaterOrEq( K attrVal ) throws Exception
- {
- return forward.hasGreaterOrEqual( attrVal );
- }
-
-
- /**
- * {@inheritDoc}
- */
- public boolean forwardGreaterOrEq( K attrVal, String id ) throws Exception
- {
- return forward.hasGreaterOrEqual( attrVal, id );
- }
-
-
- /**
- * {@inheritDoc}
- */
- public boolean forwardLessOrEq( K attrVal ) throws Exception
- {
- return forward.hasLessOrEqual( attrVal );
- }
-
-
- /**
- * {@inheritDoc}
- */
- public boolean forwardLessOrEq( K attrVal, String id ) throws Exception
- {
- return forward.hasLessOrEqual( attrVal, id );
- }
-
-
- /**
- * {@inheritDoc}
- */
public String forwardLookup( K attrVal ) throws Exception
{
return forward.get( attrVal );
@@ -391,70 +355,6 @@ public class AvlIndex<K> extends Abstrac
/**
* {@inheritDoc}
*/
- public boolean reverseGreaterOrEq( String id ) throws Exception
- {
- if ( withReverse )
- {
- return reverse.hasGreaterOrEqual( id );
- }
- else
- {
- return false;
- }
- }
-
-
- /**
- * {@inheritDoc}
- */
- public boolean reverseGreaterOrEq( String id, K attrVal ) throws LdapException
- {
- if ( withReverse )
- {
- return reverse.hasGreaterOrEqual( id, attrVal );
- }
- else
- {
- return false;
- }
- }
-
-
- /**
- * {@inheritDoc}
- */
- public boolean reverseLessOrEq( String id ) throws Exception
- {
- if ( withReverse )
- {
- return reverse.hasLessOrEqual( id );
- }
- else
- {
- return false;
- }
- }
-
-
- /**
- * {@inheritDoc}
- */
- public boolean reverseLessOrEq( String id, K attrVal ) throws Exception
- {
- if ( withReverse )
- {
- return reverse.hasLessOrEqual( id, attrVal );
- }
- else
- {
- return false;
- }
- }
-
-
- /**
- * {@inheritDoc}
- */
public K reverseLookup( String id ) throws LdapException
{
if ( withReverse )
Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/GreaterEqEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/GreaterEqEvaluator.java?rev=1540320&r1=1540319&r2=1540320&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/GreaterEqEvaluator.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/GreaterEqEvaluator.java Sat Nov 9 14:52:37 2013
@@ -90,11 +90,6 @@ public class GreaterEqEvaluator<T> exten
public boolean evaluate( IndexEntry<?, String> indexEntry ) throws LdapException
{
- if ( idx != null && idx.isDupsEnabled() )
- {
- return idx.reverseGreaterOrEq( indexEntry.getId(), node.getValue().getValue() );
- }
-
Entry entry = indexEntry.getEntry();
// resuscitate the entry if it has not been and set entry in IndexEntry