directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r658808 - /directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/
Date Wed, 21 May 2008 18:52:35 GMT
Author: akarasulu
Date: Wed May 21 11:52:34 2008
New Revision: 658808

URL: http://svn.apache.org/viewvc?rev=658808&view=rev
Log:
more generics corrections and fixing compilation issues with Cursors

Modified:
    directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java
    directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateEvaluator.java
    directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultOptimizer.java
    directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java
    directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityCursor.java
    directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityEvaluator.java
    directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqCursor.java
    directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqEvaluator.java
    directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqCursor.java
    directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqEvaluator.java

Modified: directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java?rev=658808&r1=658807&r2=658808&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java
(original)
+++ directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java
Wed May 21 11:52:34 2008
@@ -20,12 +20,14 @@
 package org.apache.directory.server.xdbm.search.impl;
 
 
+import org.apache.directory.server.xdbm.Index;
 import org.apache.directory.server.xdbm.IndexEntry;
 import org.apache.directory.server.xdbm.Store;
 import org.apache.directory.server.xdbm.AbstractIndexCursor;
 import org.apache.directory.server.xdbm.IndexCursor;
 import org.apache.directory.server.core.cursor.InvalidCursorPositionException;
 import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.shared.ldap.entry.Value;
 
 
 /**
@@ -63,11 +65,12 @@
         this.approximateEvaluator = approximateEvaluator;
 
         String attribute = approximateEvaluator.getExpression().getAttribute();
-        Object value = approximateEvaluator.getExpression().getValue();
+        Value<V> value = approximateEvaluator.getExpression().getValue();
         if ( db.hasUserIndexOn( attribute ) )
         {
             //noinspection unchecked
-            userIdxCursor = db.getUserIndex( attribute ).forwardCursor( value );
+            Index<V,ServerEntry> index = ( Index<V, ServerEntry> ) db.getUserIndex(
attribute );
+            userIdxCursor = index.forwardCursor( value.get() );
             ndnIdxCursor = null;
         }
         else

Modified: directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateEvaluator.java?rev=658808&r1=658807&r2=658808&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateEvaluator.java
(original)
+++ directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateEvaluator.java
Wed May 21 11:52:34 2008
@@ -46,13 +46,13 @@
  */
 public class ApproximateEvaluator implements Evaluator<ApproximateNode, ServerEntry>
 {
-    private final ApproximateNode node;
+    private final ApproximateNode<Object> node;
     private final Store<ServerEntry> db;
     private final Registries registries;
     private final AttributeType type;
     private final Normalizer normalizer;
     private final Comparator comparator;
-    private final Index<Number,ServerEntry> idx;
+    private final Index<Object,ServerEntry> idx;
 
 
     public ApproximateEvaluator( ApproximateNode node, Store<ServerEntry> db, Registries
registries )
@@ -65,7 +65,7 @@
         if ( db.hasUserIndexOn( node.getAttribute() ) )
         {
             //noinspection unchecked
-            idx = db.getUserIndex( node.getAttribute() );
+            idx = ( Index<Object,ServerEntry> ) db.getUserIndex( node.getAttribute()
);
             type = null;
             normalizer = null;
             comparator = null;
@@ -150,7 +150,7 @@
     {
         if ( idx != null )
         {
-            return idx.forward( ( Number ) indexEntry.getValue(), indexEntry.getId() );
+            return idx.forward( indexEntry.getValue(), indexEntry.getId() );
         }
 
         ServerEntry entry = indexEntry.getObject();

Modified: directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultOptimizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultOptimizer.java?rev=658808&r1=658807&r2=658808&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultOptimizer.java
(original)
+++ directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultOptimizer.java
Wed May 21 11:52:34 2008
@@ -245,12 +245,12 @@
      * @return the worst case
      * @throws Exception if there is an error accessing an index
      */
-    private long getEqualityScan( SimpleNode node ) throws Exception
+    private<V> long getEqualityScan( SimpleNode<V> node ) throws Exception
     {
         if ( db.hasUserIndexOn( node.getAttribute() ) )
         {
             //noinspection unchecked
-            Index<Object,E> idx = db.getUserIndex( node.getAttribute() );
+            Index<V,E> idx = ( Index<V, E> ) db.getUserIndex( node.getAttribute()
);
             return idx.count( node.getValue().get() );
         }
 
@@ -268,12 +268,12 @@
      * @return the scan count of all nodes satisfying the AVA
      * @throws Exception if there is an error accessing an index
      */
-    private long getGreaterLessScan( SimpleNode node, boolean isGreaterThan ) throws Exception
+    private<V> long getGreaterLessScan( SimpleNode<V> node, boolean isGreaterThan
) throws Exception
     {
         if ( db.hasUserIndexOn( node.getAttribute() ) )
         {
             //noinspection unchecked
-            Index<Object, E> idx = db.getUserIndex( node.getAttribute() );
+            Index<V, E> idx = ( Index<V, E> ) db.getUserIndex( node.getAttribute()
);
             if ( isGreaterThan )
             {
                 return idx.greaterThanCount( node.getValue().get() );

Modified: directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java?rev=658808&r1=658807&r2=658808&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java
(original)
+++ directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java
Wed May 21 11:52:34 2008
@@ -91,7 +91,7 @@
     /**
      * @see SearchEngine#cursor(LdapDN, AliasDerefMode, ExprNode, SearchControls)
      */
-    public IndexCursor<?,ServerEntry> cursor( LdapDN base, AliasDerefMode aliasDerefMode,
ExprNode filter,
+    public IndexCursor<Long,ServerEntry> cursor( LdapDN base, AliasDerefMode aliasDerefMode,
ExprNode filter,
                                                      SearchControls searchCtls ) throws Exception
     {
         LdapDN effectiveBase;

Modified: directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityCursor.java?rev=658808&r1=658807&r2=658808&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityCursor.java
(original)
+++ directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityCursor.java
Wed May 21 11:52:34 2008
@@ -20,12 +20,14 @@
 package org.apache.directory.server.xdbm.search.impl;
 
 
+import org.apache.directory.server.xdbm.Index;
 import org.apache.directory.server.xdbm.IndexEntry;
 import org.apache.directory.server.xdbm.Store;
 import org.apache.directory.server.xdbm.AbstractIndexCursor;
 import org.apache.directory.server.xdbm.IndexCursor;
 import org.apache.directory.server.core.cursor.InvalidCursorPositionException;
 import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.shared.ldap.entry.Value;
 
 
 /**
@@ -61,11 +63,12 @@
         this.equalityEvaluator = equalityEvaluator;
 
         String attribute = equalityEvaluator.getExpression().getAttribute();
-        Object value = equalityEvaluator.getExpression().getValue().get();
+        Value<V> value = equalityEvaluator.getExpression().getValue();
         if ( db.hasUserIndexOn( attribute ) )
         {
             //noinspection unchecked
-            userIdxCursor = db.getUserIndex( attribute ).forwardCursor( value );
+            Index<V,ServerEntry> userIndex = ( Index<V, ServerEntry> ) db.getUserIndex(
attribute ); 
+            userIdxCursor = userIndex.forwardCursor( value.get() );
             ndnIdxCursor = null;
         }
         else

Modified: directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityEvaluator.java?rev=658808&r1=658807&r2=658808&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityEvaluator.java
(original)
+++ directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityEvaluator.java
Wed May 21 11:52:34 2008
@@ -65,7 +65,7 @@
         if ( db.hasUserIndexOn( node.getAttribute() ) )
         {
             //noinspection unchecked
-            idx = db.getUserIndex( node.getAttribute() );
+            idx = ( Index<T, ServerEntry> ) db.getUserIndex( node.getAttribute() );
             type = null;
             normalizer = null;
             comparator = null;

Modified: directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqCursor.java?rev=658808&r1=658807&r2=658808&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqCursor.java
(original)
+++ directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqCursor.java
Wed May 21 11:52:34 2008
@@ -68,7 +68,7 @@
         if ( db.hasUserIndexOn( attribute ) )
         {
             //noinspection unchecked
-            userIdxCursor = db.getUserIndex( attribute ).forwardCursor();
+            userIdxCursor = ( ( Index<V,ServerEntry> ) db.getUserIndex( attribute )
).forwardCursor();
             ndnIdxCursor = null;
         }
         else

Modified: directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqEvaluator.java?rev=658808&r1=658807&r2=658808&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqEvaluator.java
(original)
+++ directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqEvaluator.java
Wed May 21 11:52:34 2008
@@ -66,7 +66,7 @@
         if ( db.hasUserIndexOn( node.getAttribute() ) )
         {
             //noinspection unchecked
-            idx = db.getUserIndex( node.getAttribute() );
+            idx = ( Index<Object,ServerEntry> ) db.getUserIndex( node.getAttribute()
);
         }
         else
         {

Modified: directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqCursor.java?rev=658808&r1=658807&r2=658808&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqCursor.java
(original)
+++ directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqCursor.java
Wed May 21 11:52:34 2008
@@ -68,7 +68,7 @@
         if ( db.hasUserIndexOn( attribute ) )
         {
             //noinspection unchecked
-            userIdxCursor = db.getUserIndex( attribute ).forwardCursor();
+            userIdxCursor = ( ( Index<V,ServerEntry> ) db.getUserIndex( attribute )
).forwardCursor();
             ndnIdxCursor = null;
         }
         else

Modified: directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqEvaluator.java?rev=658808&r1=658807&r2=658808&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqEvaluator.java
(original)
+++ directory/apacheds/branches/bigbang/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqEvaluator.java
Wed May 21 11:52:34 2008
@@ -66,7 +66,7 @@
         if ( db.hasUserIndexOn( node.getAttribute() ) )
         {
             //noinspection unchecked
-            idx = db.getUserIndex( node.getAttribute() );
+            idx = ( Index<Object,ServerEntry> ) db.getUserIndex( node.getAttribute()
);
         }
         else
         {



Mime
View raw message