You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2006/07/30 01:55:45 UTC
svn commit: r426853 -
/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
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 );