directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r426853 - /directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
Date Sat, 29 Jul 2006 23:55:45 GMT
Author: elecharny
Date: Sat Jul 29 16:55:44 2006
New Revision: 426853

URL: http://svn.apache.org/viewvc?rev=426853&view=rev
Log:
Added a protection against bad cache size ( negative or null cache size)
(this Fix DIRSERVER-680)

Modified:
    directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java

Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java?rev=426853&r1=426852&r2=426853&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
(original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
Sat Jul 29 16:55:44 2006
@@ -183,8 +183,17 @@
                 IndexConfiguration indexConfiguration = ( IndexConfiguration ) nextObject;
                 name = indexConfiguration.getAttributeId();
                 cacheSize = indexConfiguration.getCacheSize();
-                log.info( "Using cache size of {} for index on attribute {}", 
-                    new Integer( cacheSize ), name );
+                
+                if ( cacheSize <= 0 ) 
+                {
+                    log.warn( "Cache size {} for index on attribute is null or negative.
Using default value.", new Integer(cacheSize), name );
+                    cacheSize = IndexConfiguration.DEFAULT_INDEX_CACHE_SIZE;
+                }
+                else
+                {
+                    log.info( "Using cache size of {} for index on attribute {}", 
+                        new Integer( cacheSize ), name );
+                }
             }
             
             String oid = oidRegistry.getOid( name );



Mime
View raw message