You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by se...@apache.org on 2010/11/05 19:32:33 UTC

svn commit: r1031702 - /directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultOptimizer.java

Author: seelmann
Date: Fri Nov  5 18:32:32 2010
New Revision: 1031702

URL: http://svn.apache.org/viewvc?rev=1031702&view=rev
Log:
Must use attribute OID to get count from presence index. Removed a warning.

Modified:
    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/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=1031702&r1=1031701&r2=1031702&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 Fri Nov  5 18:32:32 2010
@@ -324,12 +324,11 @@ public class DefaultOptimizer<E, ID exte
      * @return the worst case full scan count
      * @throws Exception if there is an error access database indices
      */
-    @SuppressWarnings("unchecked")
     private long getFullScan( LeafNode node ) throws Exception
     {
         if ( db.hasIndexOn( node.getAttributeType() ) )
         {
-            Index idx = db.getIndex( node.getAttributeType() );
+            Index<?, ?, ?> idx = db.getIndex( node.getAttributeType() );
             return idx.count();
         }
 
@@ -350,7 +349,7 @@ public class DefaultOptimizer<E, ID exte
         if ( db.hasUserIndexOn( node.getAttributeType() ) )
         {
             Index<String, E, ID> idx = db.getPresenceIndex();
-            return idx.count( node.getAttribute() );
+            return idx.count( node.getAttributeType().getOid() );
         }
         else if ( db.hasSystemIndexOn( node.getAttributeType() ) )
         {