directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1507201 - in /directory/apacheds/trunk: jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/ protocol-ldap/s...
Date Fri, 26 Jul 2013 07:06:06 GMT
Author: elecharny
Date: Fri Jul 26 07:06:06 2013
New Revision: 1507201

URL: http://svn.apache.org/r1507201
Log:
o The Index/Table/Store count() and related method now returns long
o 

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/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
    directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotIndex.java
    directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotTable.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaEventLog.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/admin/AdministrativePointPersistentIT.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.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/Store.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/impl/avl/AvlTable.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=1507201&r1=1507200&r2=1507201&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
Fri Jul 26 07:06:06 2013
@@ -310,7 +310,7 @@ public class JdbmIndex<K, V> extends Abs
     /**
      * {@inheritDoc}
      */
-    public int count() throws IOException
+    public long count() throws IOException
     {
         return forward.count();
     }
@@ -319,13 +319,13 @@ public class JdbmIndex<K, V> extends Abs
     /**
      * {@inheritDoc}
      */
-    public int count( K attrVal ) throws Exception
+    public long count( K attrVal ) throws Exception
     {
         return forward.count( attrVal );
     }
 
 
-    public int greaterThanCount( K attrVal ) throws Exception
+    public long greaterThanCount( K attrVal ) throws Exception
     {
         return forward.greaterThanCount( attrVal );
     }
@@ -334,7 +334,7 @@ public class JdbmIndex<K, V> extends Abs
     /**
      * @see org.apache.directory.server.xdbm.Index#lessThanCount(java.lang.Object)
      */
-    public int lessThanCount( K attrVal ) throws Exception
+    public long lessThanCount( K attrVal ) throws Exception
     {
         return forward.lessThanCount( attrVal );
     }

Modified: directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java?rev=1507201&r1=1507200&r2=1507201&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
(original)
+++ directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
Fri Jul 26 07:06:06 2013
@@ -163,7 +163,7 @@ public class JdbmTable<K, V> extends Abs
             bt = new BTree<K, V>().load( recMan, recId );
             ( ( SerializableComparator<K> ) bt.getComparator() ).setSchemaManager(
schemaManager );
             recId = recMan.getNamedObject( name + SZSUFFIX );
-            count = ( Integer ) recMan.fetch( recId );
+            count = ( Long ) recMan.fetch( recId );
         }
     }
 
@@ -205,7 +205,17 @@ public class JdbmTable<K, V> extends Abs
             ( ( SerializableComparator<K> ) bt.getComparator() ).setSchemaManager(
schemaManager );
             bt.setValueSerializer( valueSerializer );
             recId = recMan.getNamedObject( name + SZSUFFIX );
-            count = ( Integer ) recMan.fetch( recId );
+
+            Object value = recMan.fetch( recId );
+
+            if ( value instanceof Integer )
+            {
+                count = ( ( Integer ) value ).longValue();
+            }
+            else
+            {
+                count = ( Long ) value;
+            }
         }
         else
         {
@@ -249,31 +259,31 @@ public class JdbmTable<K, V> extends Abs
     /**
      * @see Table#greaterThanCount(Object)
      */
-    public int greaterThanCount( K key ) throws IOException
+    public long greaterThanCount( K key ) throws IOException
     {
         // take a best guess
-        return Math.min( count, 10 );
+        return Math.min( count, 10L );
     }
 
 
     /**
      * @see Table#lessThanCount(Object)
      */
-    public int lessThanCount( K key ) throws IOException
+    public long lessThanCount( K key ) throws IOException
     {
         // take a best guess
-        return Math.min( count, 10 );
+        return Math.min( count, 10L );
     }
 
 
     /**
      * @see org.apache.directory.server.xdbm.Table#count(java.lang.Object)
      */
-    public int count( K key ) throws LdapException
+    public long count( K key ) throws LdapException
     {
         if ( key == null )
         {
-            return 0;
+            return 0L;
         }
 
         try
@@ -282,11 +292,11 @@ public class JdbmTable<K, V> extends Abs
             {
                 if ( null == bt.find( key ) )
                 {
-                    return 0;
+                    return 0L;
                 }
                 else
                 {
-                    return 1;
+                    return 1L;
                 }
             }
 

Modified: directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotIndex.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotIndex.java?rev=1507201&r1=1507200&r2=1507201&view=diff
==============================================================================
--- directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotIndex.java
(original)
+++ directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotIndex.java
Fri Jul 26 07:06:06 2013
@@ -157,7 +157,7 @@ public class MavibotIndex<K, V> extends 
 
         SerializableComparator<K> comp = new SerializableComparator<K>( mr.getOid()
);
         comp.setSchemaManager( schemaManager );
-        
+
         /*
          * The forward key/value map stores attribute values to master table
          * primary keys.  A value for an attribute can occur several times in
@@ -246,7 +246,7 @@ public class MavibotIndex<K, V> extends 
     /**
      * {@inheritDoc}
      */
-    public int count() throws IOException
+    public long count() throws IOException
     {
         return forward.count();
     }
@@ -255,13 +255,13 @@ public class MavibotIndex<K, V> extends 
     /**
      * {@inheritDoc}
      */
-    public int count( K attrVal ) throws Exception
+    public long count( K attrVal ) throws Exception
     {
         return forward.count( attrVal );
     }
 
 
-    public int greaterThanCount( K attrVal ) throws Exception
+    public long greaterThanCount( K attrVal ) throws Exception
     {
         return forward.greaterThanCount( attrVal );
     }
@@ -270,7 +270,7 @@ public class MavibotIndex<K, V> extends 
     /**
      * @see org.apache.directory.server.xdbm.Index#lessThanCount(java.lang.Object)
      */
-    public int lessThanCount( K attrVal ) throws Exception
+    public long lessThanCount( K attrVal ) throws Exception
     {
         return forward.lessThanCount( attrVal );
     }

Modified: directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotTable.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotTable.java?rev=1507201&r1=1507200&r2=1507201&view=diff
==============================================================================
--- directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotTable.java
(original)
+++ directory/apacheds/trunk/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotTable.java
Fri Jul 26 07:06:06 2013
@@ -90,6 +90,9 @@ public class MavibotTable<K, V> extends 
 
         this.allowsDuplicates = allowDuplicates;
         arrayMarshaller = new ArrayMarshaller<V>( valueComparator );
+
+        // Initialize the count
+        count = bt.getNbElems();
     }
 
 
@@ -469,7 +472,7 @@ public class MavibotTable<K, V> extends 
 
 
     @Override
-    public int count( K key ) throws Exception
+    public long count( K key ) throws Exception
     {
         if ( key == null )
         {
@@ -480,12 +483,12 @@ public class MavibotTable<K, V> extends 
         {
             if ( !allowsDuplicates )
             {
-                return 1;
+                return 1L;
             }
             else
             {
                 BTree<V, V> values = bt.getValues( key );
-                return ( int ) values.getNbElems();
+                return values.getNbElems();
             }
         }
 
@@ -494,18 +497,18 @@ public class MavibotTable<K, V> extends 
 
 
     @Override
-    public int greaterThanCount( K key ) throws Exception
+    public long greaterThanCount( K key ) throws Exception
     {
         // take a best guess
-        return Math.min( count, 10 );
+        return Math.min( count, 10L );
     }
 
 
     @Override
-    public int lessThanCount( K key ) throws Exception
+    public long lessThanCount( K key ) throws Exception
     {
         // take a best guess
-        return Math.min( count, 10 );
+        return Math.min( count, 10L );
     }
 
 

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaEventLog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaEventLog.java?rev=1507201&r1=1507200&r2=1507201&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaEventLog.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaEventLog.java
Fri Jul 26 07:06:06 2013
@@ -454,7 +454,7 @@ public class ReplicaEventLog implements 
     /**
      * @return the number of entries present in the replica log
      */
-    public synchronized int count()
+    public synchronized long count()
     {
         try
         {

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/admin/AdministrativePointPersistentIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/admin/AdministrativePointPersistentIT.java?rev=1507201&r1=1507200&r2=1507201&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/admin/AdministrativePointPersistentIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/admin/AdministrativePointPersistentIT.java
Fri Jul 26 07:06:06 2013
@@ -175,6 +175,11 @@ public void testPersistAutonomousArea() 
 {
     assertTrue( getLdapServer().isStarted() );
 
+    // Check the caches
+    DnNode<AccessControlAdministrativePoint> acCache = getLdapServer().getDirectoryService().getAccessControlAPCache();
+    AdministrativePoint aap1 = acCache.getElement( new Dn( schemaManager, "ou=AAP1,ou=noAP1,ou=system"
) );
+    assertNotNull( aap1 );
+
     // Stop the server now, we will restart it immediately 
     getLdapServer().stop();
     assertFalse( getLdapServer().isStarted() );
@@ -197,7 +202,7 @@ public void testPersistAutonomousArea() 
     assertEquals( "autonomousArea", getAdminRole( "ou=subAAP1,ou=noAP3,ou=AAP2,ou=system"
).getString() );
 
     // Check the caches
-    DnNode<AccessControlAdministrativePoint> acCache = getLdapServer().getDirectoryService().getAccessControlAPCache();
+    acCache = getLdapServer().getDirectoryService().getAccessControlAPCache();
     DnNode<CollectiveAttributeAdministrativePoint> caCache = getLdapServer().getDirectoryService()
         .getCollectiveAttributeAPCache();
     DnNode<TriggerExecutionAdministrativePoint> teCache = getLdapServer().getDirectoryService()
@@ -205,7 +210,7 @@ public void testPersistAutonomousArea() 
     DnNode<SubschemaAdministrativePoint> ssCache = getLdapServer().getDirectoryService().getSubschemaAPCache();
 
     // The ACs
-    AdministrativePoint aap1 = acCache.getElement( new Dn( schemaManager, "ou=AAP1,ou=noAP1,ou=system"
) );
+    aap1 = acCache.getElement( new Dn( schemaManager, "ou=AAP1,ou=noAP1,ou=system" ) );
     assertNotNull( aap1 );
 
     AdministrativePoint aap2 = acCache.getElement( new Dn( schemaManager, "ou=AAP2,ou=system"
) );

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java?rev=1507201&r1=1507200&r2=1507201&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
Fri Jul 26 07:06:06 2013
@@ -828,7 +828,7 @@ public abstract class AbstractBTreeParti
                 throw new LdapNoSuchObjectException( I18n.err( I18n.ERR_699, dn ) );
             }
 
-            int childCount = getChildCount( id );
+            long childCount = getChildCount( id );
 
             if ( childCount > 0 )
             {
@@ -2191,7 +2191,7 @@ public abstract class AbstractBTreeParti
     /**
      * {@inheritDoc}
      */
-    public int count() throws Exception
+    public long count() throws Exception
     {
         return master.count();
     }
@@ -2200,7 +2200,7 @@ public abstract class AbstractBTreeParti
     /**
      * {@inheritDoc}
      */
-    public final int getChildCount( String id ) throws LdapException
+    public final long getChildCount( String id ) throws LdapException
     {
         try
         {

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=1507201&r1=1507200&r2=1507201&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
Fri Jul 26 07:06:06 2013
@@ -51,7 +51,7 @@ public abstract class AbstractTable<K, V
     protected final Comparator<V> valueComparator;
 
     /** the current count of entries in this Table */
-    protected int count;
+    protected long count;
 
     /** whether or not this table allows for duplicates */
     protected boolean allowsDuplicates;
@@ -119,7 +119,7 @@ public abstract class AbstractTable<K, V
     /**
      * {@inheritDoc}
      */
-    public int count() throws IOException
+    public long count() throws IOException
     {
         return count;
     }

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=1507201&r1=1507200&r2=1507201&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
Fri Jul 26 07:06:06 2013
@@ -119,7 +119,7 @@ public interface Index<K, O, ID>
      * @return the number of key/value pairs in this index
      * @throws Exception on failure to access index db files
      */
-    int count() throws Exception;
+    long count() throws Exception;
 
 
     /**
@@ -130,13 +130,13 @@ public interface Index<K, O, ID>
      * @return the number of key/value pairs in this index with the value value
      * @throws Exception on failure to access index db files
      */
-    int count( K attrVal ) throws Exception;
+    long count( K attrVal ) throws Exception;
 
 
-    int greaterThanCount( K attrVal ) throws Exception;
+    long greaterThanCount( K attrVal ) throws Exception;
 
 
-    int lessThanCount( K attrVal ) throws Exception;
+    long lessThanCount( K attrVal ) throws Exception;
 
 
     ID forwardLookup( K attrVal ) throws Exception;

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java?rev=1507201&r1=1507200&r2=1507201&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java
Fri Jul 26 07:06:06 2013
@@ -312,7 +312,7 @@ public interface Store
      * @return the total count of entries within this store
      * @throws Exception on failures to access the underlying store
      */
-    int count() throws Exception;
+    long count() throws Exception;
 
 
     /**
@@ -353,7 +353,7 @@ public interface Store
      * @return the child count
      * @throws Exception on failures to access the underlying store
      */
-    int getChildCount( String id ) throws Exception;
+    long getChildCount( String id ) 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=1507201&r1=1507200&r2=1507201&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
Fri Jul 26 07:06:06 2013
@@ -278,7 +278,7 @@ public interface Table<K, V>
      * @return the number of records
      * @throws Exception if there is a failure to read the underlying Db
      */
-    int count() throws Exception;
+    long count() throws Exception;
 
 
     /**
@@ -289,7 +289,7 @@ public interface Table<K, V>
      * @return the number of duplicate records for a key.
      * @throws Exception if there is a failure to read the underlying Db
      */
-    int count( K key ) throws Exception;
+    long count( K key ) throws Exception;
 
 
     /**
@@ -301,7 +301,7 @@ public interface Table<K, V>
      * @return the number of keys greater than or equal to the key
      * @throws Exception if there is a failure to read the underlying db
      */
-    int greaterThanCount( K key ) throws Exception;
+    long greaterThanCount( K key ) throws Exception;
 
 
     /**
@@ -313,7 +313,7 @@ public interface Table<K, V>
      * @return the number of keys less than or equal to the key
      * @throws Exception if there is a failure to read the underlying db
      */
-    int lessThanCount( K key ) throws Exception;
+    long lessThanCount( K key ) throws Exception;
 
 
     /**

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=1507201&r1=1507200&r2=1507201&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
Fri Jul 26 07:06:06 2013
@@ -152,7 +152,7 @@ public class AvlIndex<K, O> extends Abst
     /**
      * {@inheritDoc}
      */
-    public int count() throws Exception
+    public long count() throws Exception
     {
         return forward.count();
     }
@@ -161,7 +161,7 @@ public class AvlIndex<K, O> extends Abst
     /**
      * {@inheritDoc}
      */
-    public int count( K attrVal ) throws Exception
+    public long count( K attrVal ) throws Exception
     {
         return forward.count( attrVal );
     }
@@ -307,7 +307,7 @@ public class AvlIndex<K, O> extends Abst
     /**
      * {@inheritDoc}
      */
-    public int greaterThanCount( K attrVal ) throws Exception
+    public long greaterThanCount( K attrVal ) throws Exception
     {
         return forward.greaterThanCount( attrVal );
     }
@@ -316,7 +316,7 @@ public class AvlIndex<K, O> extends Abst
     /**
      * {@inheritDoc}
      */
-    public int lessThanCount( K attrVal ) throws Exception
+    public long lessThanCount( K attrVal ) throws Exception
     {
         return forward.lessThanCount( attrVal );
     }

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlTable.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlTable.java?rev=1507201&r1=1507200&r2=1507201&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlTable.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlTable.java
Fri Jul 26 07:06:06 2013
@@ -49,6 +49,7 @@ public class AvlTable<K, V> extends Abst
     private final AvlTreeMap<K, V> avl;
     private final Comparator<Tuple<K, V>> keyOnlytupleComparator;
 
+
     public AvlTable( String name, final Comparator<K> keyComparator, final Comparator<V>
valueComparator,
         boolean dupsEnabled )
     {
@@ -77,18 +78,18 @@ public class AvlTable<K, V> extends Abst
     /**
      * {@inheritDoc}
      */
-    public int count( K key ) throws Exception
+    public long count( K key ) throws Exception
     {
         if ( key == null )
         {
-            return 0;
+            return 0L;
         }
 
         LinkedAvlMapNode<K, V> node = avl.find( key );
 
         if ( node == null )
         {
-            return 0;
+            return 0L;
         }
 
         SingletonOrOrderedSet<V> val = node.getValue();
@@ -98,7 +99,7 @@ public class AvlTable<K, V> extends Abst
             return val.getOrderedSet().getSize();
         }
 
-        return 1;
+        return 1L;
     }
 
 
@@ -133,7 +134,7 @@ public class AvlTable<K, V> extends Abst
     /**
      * {@inheritDoc}
      */
-    public int greaterThanCount( K key ) throws Exception
+    public long greaterThanCount( K key ) throws Exception
     {
         return avl.getSize();
     }
@@ -261,7 +262,7 @@ public class AvlTable<K, V> extends Abst
     /**
      * {@inheritDoc}
      */
-    public int lessThanCount( K key ) throws Exception
+    public long lessThanCount( K key ) throws Exception
     {
         return count;
     }
@@ -331,7 +332,7 @@ public class AvlTable<K, V> extends Abst
     {
         if ( !allowsDuplicates )
         {
-            return new AvlTreeMapNoDupsWrapperCursor<K, V>( 
+            return new AvlTreeMapNoDupsWrapperCursor<K, V>(
                 new AvlSingletonOrOrderedSetCursor<K, V>( avl ) );
         }
 



Mime
View raw message