directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1510343 - in /directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl: CursorBuilder.java DefaultOptimizer.java
Date Sun, 04 Aug 2013 20:44:15 GMT
Author: seelmann
Date: Sun Aug  4 20:44:14 2013
New Revision: 1510343

URL: http://svn.apache.org/r1510343
Log:
Reset candidates annotation for the case that the filter is reused during a RootDSE based
search.

Modified:
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/CursorBuilder.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultOptimizer.java

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/CursorBuilder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/CursorBuilder.java?rev=1510343&r1=1510342&r2=1510343&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/CursorBuilder.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/CursorBuilder.java
Sun Aug  4 20:44:14 2013
@@ -193,7 +193,7 @@ public class CursorBuilder
     private <T> long computeEquality( EqualityNode<T> node, PartitionSearchResult
searchResult )
         throws Exception
     {
-        Set<String> thisCandidates = ( Set<String> ) node.get( "candidates" );
+        Set<String> thisCandidates = ( Set<String> ) node.get( DefaultOptimizer.CANDIDATES_ANNOTATION_KEY
);
 
         if ( thisCandidates != null )
         {

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultOptimizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultOptimizer.java?rev=1510343&r1=1510342&r2=1510343&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultOptimizer.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultOptimizer.java
Sun Aug  4 20:44:14 2013
@@ -58,6 +58,8 @@ import org.apache.directory.server.xdbm.
  */
 public class DefaultOptimizer<E> implements Optimizer
 {
+    static final String CANDIDATES_ANNOTATION_KEY = "candidates";
+
     /** the database this optimizer operates on */
     private final Store db;
     private String contextEntryId;
@@ -325,12 +327,15 @@ public class DefaultOptimizer<E> impleme
             if ( nbFound < 100 )
             {
                 // Store the found candidates in the node
-                node.set( "candidates", values );
+                node.set( CANDIDATES_ANNOTATION_KEY, values );
 
                 return values.size();
             }
             else
             {
+                // Reset the candidates annotation
+                node.set( CANDIDATES_ANNOTATION_KEY, null );
+
                 return idx.count( node.getValue().getValue() );
             }
         }



Mime
View raw message