directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1376108 - /directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/
Date Wed, 22 Aug 2012 15:58:50 GMT
Author: elecharny
Date: Wed Aug 22 15:58:50 2012
New Revision: 1376108

URL: http://svn.apache.org/viewvc?rev=1376108&view=rev
Log:
Removed the evaluateId() method, is never used anywhere.

Modified:
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityEvaluator.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqEvaluator.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqEvaluator.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeEvaluator.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/PresenceEvaluator.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubstringEvaluator.java

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java?rev=1376108&r1=1376107&r2=1376108&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java
Wed Aug 22 15:58:50 2012
@@ -52,7 +52,7 @@ public class DefaultSearchEngine<ID exte
 {
     /** the Optimizer used by this DefaultSearchEngine */
     private final Optimizer optimizer;
-    
+
     /** the Database this DefaultSearchEngine operates on */
     private final Store<Entry, ID> db;
     /** creates Cursors over entries satisfying filter expressions */
@@ -147,7 +147,7 @@ public class DefaultSearchEngine<ID exte
         // Specifically Handle Object Level Scope
         // --------------------------------------------------------------------
         ID effectiveBaseId = baseId;
-        
+
         if ( effectiveBase != base )
         {
             effectiveBaseId = db.getEntryId( effectiveBase );
@@ -159,10 +159,10 @@ public class DefaultSearchEngine<ID exte
             indexEntry.setId( effectiveBaseId );
             optimizer.annotate( filter );
             Evaluator<? extends ExprNode, Entry, ID> evaluator = evaluatorBuilder.build(
filter );
-            
+
             // Fetch the entry, as we have only one
             Entry entry = null;
-            
+
             if ( effectiveBase != base )
             {
                 entry = db.lookup( indexEntry.getId() );
@@ -171,7 +171,7 @@ public class DefaultSearchEngine<ID exte
             {
                 entry = db.lookup( indexEntry.getId(), effectiveBase );
             }
-            
+
             indexEntry.setEntry( entry );
 
             if ( evaluator.evaluate( indexEntry ) )
@@ -192,7 +192,7 @@ public class DefaultSearchEngine<ID exte
 
         // Annotate the node with the optimizer and return search enumeration.
         optimizer.annotate( root );
-        
+
         return ( IndexCursor<ID, Entry, ID> ) cursorBuilder.build( root );
     }
 

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityEvaluator.java?rev=1376108&r1=1376107&r2=1376108&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityEvaluator.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityEvaluator.java
Wed Aug 22 15:58:50 2012
@@ -151,17 +151,6 @@ public class EqualityEvaluator<T, ID ext
     }
 
 
-    public boolean evaluateId( ID id ) throws Exception
-    {
-        if ( idx != null )
-        {
-            return idx.reverse( id );
-        }
-
-        return evaluateEntry( db.lookup( id ) );
-    }
-
-
     // TODO - determine if comparator and index entry should have the Value
     // wrapper or the raw normalized value
     private boolean evaluate( Attribute attribute ) throws Exception

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqEvaluator.java?rev=1376108&r1=1376107&r2=1376108&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqEvaluator.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqEvaluator.java
Wed Aug 22 15:58:50 2012
@@ -150,17 +150,6 @@ public class GreaterEqEvaluator<T, ID ex
     }
 
 
-    public boolean evaluateId( ID id ) throws Exception
-    {
-        if ( idx != null && idx.isDupsEnabled() )
-        {
-            return idx.reverseGreaterOrEq( id, node.getValue().getValue() );
-        }
-
-        return evaluateEntry( db.lookup( id ) );
-    }
-
-
     public boolean evaluateEntry( Entry entry ) throws Exception
     {
         // get the attribute

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqEvaluator.java?rev=1376108&r1=1376107&r2=1376108&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqEvaluator.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqEvaluator.java
Wed Aug 22 15:58:50 2012
@@ -87,17 +87,6 @@ public class LessEqEvaluator<T, ID exten
     }
 
 
-    public boolean evaluateId( ID id ) throws Exception
-    {
-        if ( ( idx != null ) && idx.isDupsEnabled() )
-        {
-            return idx.reverseLessOrEq( id, node.getValue().getValue() );
-        }
-
-        return evaluateEntry( db.lookup( id ) );
-    }
-
-
     public boolean evaluate( IndexEntry<?, ID> indexEntry ) throws Exception
     {
         if ( ( idx != null ) && idx.isDupsEnabled() )

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeEvaluator.java?rev=1376108&r1=1376107&r2=1376108&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeEvaluator.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeEvaluator.java
Wed Aug 22 15:58:50 2012
@@ -75,63 +75,6 @@ public class OneLevelScopeEvaluator<E, I
      * Asserts whether or not a candidate has one level scope while taking
      * alias dereferencing into account.
      *
-     * @param candidate the candidate to assert
-     * @return true if the candidate is within one level scope
-     * @throws Exception if db lookups fail
-     * @see org.apache.directory.server.xdbm.search.Evaluator#evaluate(IndexEntry)
-     */
-    public boolean evaluateId( ID candidate ) throws Exception
-    {
-        ParentIdAndRdn<ID> parent = db.getRdnIndex().reverseLookup( candidate );
-        boolean isChild = parent.getParentId().equals( baseId );
-
-        /*
-         * The candidate id could be any entry in the db.  If search
-         * dereferencing is not enabled then we return the results of the child
-         * test.
-         */
-        if ( !dereferencing )
-        {
-            return isChild;
-        }
-
-        /*
-         * From here down alias dereferencing is enabled.  We determine if the
-         * candidate id is an alias, if so we reject it since aliases should
-         * not be returned.
-         */
-        if ( null != db.getAliasIndex().reverseLookup( candidate ) )
-        {
-            return false;
-        }
-
-        /*
-         * The candidate is NOT an alias at this point.  So if it is a child we
-         * just return true since it is in normal one level scope.
-         */
-        if ( isChild )
-        {
-            return true;
-        }
-
-        /*
-         * At this point the candidate is not a child and it is not an alias.
-         * We need to check if the candidate is in extended one level scope by
-         * performing a lookup on the one level alias index.  This index stores
-         * a tuple mapping the baseId to the id of objects brought into the
-         * one level scope of the base by an alias: ( baseId, aliasedObjId )
-         * If the candidate id is an object brought into one level scope then
-         * the lookup returns true accepting the candidate.  Otherwise the
-         * candidate is rejected with a false return because it is not in scope.
-         */
-        return db.getOneAliasIndex().forward( baseId, candidate );
-    }
-
-
-    /**
-     * Asserts whether or not a candidate has one level scope while taking
-     * alias dereferencing into account.
-     *
      * TODO - terribly inefficient - would benefit from exposing the id of an
      * entry within the Entry
      *

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/PresenceEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/PresenceEvaluator.java?rev=1376108&r1=1376107&r2=1376108&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/PresenceEvaluator.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/PresenceEvaluator.java
Wed Aug 22 15:58:50 2012
@@ -112,19 +112,6 @@ public class PresenceEvaluator<ID extend
 
     // TODO - determine if comaparator and index entry should have the Value
     // wrapper or the raw normalized value
-    public boolean evaluateId( ID id ) throws Exception
-    {
-        if ( idx != null )
-        {
-            return idx.forward( attributeType.getOid(), id );
-        }
-
-        return evaluateEntry( db.lookup( id ) );
-    }
-
-
-    // TODO - determine if comaparator and index entry should have the Value
-    // wrapper or the raw normalized value
     public boolean evaluateEntry( Entry entry ) throws Exception
     {
         if ( db.hasSystemIndexOn( attributeType ) )

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubstringEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubstringEvaluator.java?rev=1376108&r1=1376107&r2=1376108&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubstringEvaluator.java
(original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubstringEvaluator.java
Wed Aug 22 15:58:50 2012
@@ -23,7 +23,6 @@ package org.apache.directory.server.xdbm
 import java.util.Iterator;
 import java.util.regex.Pattern;
 
-import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.xdbm.Index;
 import org.apache.directory.server.xdbm.IndexEntry;
 import org.apache.directory.server.xdbm.Store;
@@ -138,20 +137,6 @@ public class SubstringEvaluator<ID exten
     }
 
 
-    public boolean evaluateId( ID id ) throws Exception
-    {
-
-        if ( idx == null )
-        {
-            return evaluateWithoutIndex( id );
-        }
-        else
-        {
-            return evaluateWithIndex( id );
-        }
-    }
-
-
     public boolean evaluateEntry( Entry entry ) throws Exception
     {
 
@@ -162,7 +147,7 @@ public class SubstringEvaluator<ID exten
         }
         else
         {
-            return evaluateWithIndex();
+            return evaluateWithoutIndex( entry );
         }
     }
 
@@ -209,50 +194,6 @@ public class SubstringEvaluator<ID exten
     }
 
 
-    private boolean evaluateWithIndex() throws Exception
-    {
-        throw new UnsupportedOperationException( I18n.err( I18n.ERR_721 ) );
-    }
-
-
-    private boolean evaluateWithIndex( ID id ) throws Exception
-    {
-        /*
-         * Note that this is using the reverse half of the index giving a
-         * considerable performance improvement on this kind of operation.
-         * Otherwise we would have to scan the entire index if there were
-         * no reverse lookups.
-         */
-        Cursor<IndexEntry<String, ID>> entries = idx.reverseCursor( id );
-
-        // cycle through the attribute values testing for a match
-        while ( entries.next() )
-        {
-            IndexEntry<String, ID> rec = entries.get();
-
-            // once match is found cleanup and return true
-            if ( regex.matcher( rec.getKey() ).matches() )
-            {
-                entries.close();
-                return true;
-            }
-        }
-
-        entries.close();
-
-        // we fell through so a match was not found - assertion was false.
-        return false;
-    }
-
-
-    // TODO - determine if comaparator and index entry should have the Value
-    // wrapper or the raw normalized value
-    private boolean evaluateWithoutIndex( ID id ) throws Exception
-    {
-        return evaluateWithoutIndex( db.lookup( id ) );
-    }
-
-
     // TODO - determine if comaparator and index entry should have the Value
     // wrapper or the raw normalized value
     private boolean evaluateWithoutIndex( Entry entry ) throws Exception



Mime
View raw message