directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r991004 - in /directory/apacheds/trunk/core-api/src/main: java/org/apache/directory/server/core/CacheService.java resources/directory-cacheservice.xml
Date Mon, 30 Aug 2010 22:11:54 GMT
Author: kayyagari
Date: Mon Aug 30 22:11:54 2010
New Revision: 991004

URL: http://svn.apache.org/viewvc?rev=991004&view=rev
Log:
o fixed illegal state exception caused by destroy method of cache service by just clearing
all caches instead of shutting down
o added cache configuration for DN cache

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/CacheService.java
    directory/apacheds/trunk/core-api/src/main/resources/directory-cacheservice.xml

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/CacheService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/CacheService.java?rev=991004&r1=991003&r2=991004&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/CacheService.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/CacheService.java
Mon Aug 30 22:11:54 2010
@@ -79,14 +79,8 @@ public class CacheService
 
     public void destroy()
     {
-        if ( cacheManager.getStatus() == Status.STATUS_ALIVE )
-        {
-            LOG.info( "destroying the cache service" );
-
-            cacheManager.removalAll();
-
-            cacheManager.shutdown();
-        }
+        LOG.info( "clearing all the caches" );
+        cacheManager.clearAll();
     }
 
 

Modified: directory/apacheds/trunk/core-api/src/main/resources/directory-cacheservice.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/resources/directory-cacheservice.xml?rev=991004&r1=991003&r2=991004&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/resources/directory-cacheservice.xml (original)
+++ directory/apacheds/trunk/core-api/src/main/resources/directory-cacheservice.xml Mon Aug
30 22:11:54 2010
@@ -1,43 +1,110 @@
-<?xml version="1.0" encoding="UTF-8"?>       
+<?xml version="1.0" encoding="UTF-8"?>
 <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:noNamespaceSchemaLocation="ehcache.xsd"
-         updateCheck="false" monitoring="autodetect"
-         dynamicConfig="true" >
-   
-    <diskStore path="java.io.tmpdir"/>
+	xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="false"
+	monitoring="autodetect" dynamicConfig="true">
 
-    <cacheManagerEventListenerFactory class="" properties=""/>
+	<diskStore path="java.io.tmpdir" />
 
     <!--
-    Mandatory Default Cache configuration. These settings will be applied to caches
-    created programmtically using CacheManager.add(String cacheName).
+    Cache configuration
+    ===================
 
-    The defaultCache has an implicit name "default" which is a reserved cache name.
-    -->
-    <defaultCache
-           maxElementsInMemory="0"
-           eternal="false"
-           overflowToDisk="true"
-           timeToIdleSeconds="1200"
-           timeToLiveSeconds="1200">
-    </defaultCache>
+    The following attributes are required.
 
-    <!--
-    Sample cache named sampleCache1
-    This cache contains a maximum in memory of 10000 elements, and will expire
-    an element if it is idle for more than 5 minutes and lives for more than
-    10 minutes.
-
-    If there are more than 10000 elements it will overflow to the
-    disk cache, which in this configuration will go to wherever java.io.tmp is
-    defined on your system. On a standard Linux system this will be /tmp"
-    -->
-    <cache name="groupCache"
-           maxElementsInMemory="10000"
-           maxElementsOnDisk="1000"
-           eternal="true"
-           overflowToDisk="true"
-           diskSpoolBufferSizeMB="20"
-           timeToIdleSeconds="300"
-           timeToLiveSeconds="600"/>
+    name:
+    Sets the name of the cache. This is used to identify the cache. It must be unique.
+
+    maxElementsInMemory:
+    Sets the maximum number of objects that will be created in memory
+
+    maxElementsOnDisk:
+    Sets the maximum number of objects that will be maintained in the DiskStore
+    The default value is zero, meaning unlimited.
+
+    eternal:
+    Sets whether elements are eternal. If eternal,  timeouts are ignored and the
+    element is never expired.
+
+    overflowToDisk:
+    Sets whether elements can overflow to disk when the memory store
+    has reached the maxInMemory limit.
+
+    The following attributes and elements are optional.
+
+    timeToIdleSeconds:
+    Sets the time to idle for an element before it expires.
+    i.e. The maximum amount of time between accesses before an element expires
+    Is only used if the element is not eternal.
+    Optional attribute. A value of 0 means that an Element can idle for infinity.
+    The default value is 0.
+
+    timeToLiveSeconds:
+    Sets the time to live for an element before it expires.
+    i.e. The maximum time between creation time and when an element expires.
+    Is only used if the element is not eternal.
+    Optional attribute. A value of 0 means that and Element can live for infinity.
+    The default value is 0.
+
+    diskPersistent:
+    Whether the disk store persists between restarts of the Virtual Machine.
+    The default value is false.
+
+    diskExpiryThreadIntervalSeconds:
+    The number of seconds between runs of the disk expiry thread. The default value
+    is 120 seconds.
+
+    diskSpoolBufferSizeMB:
+    This is the size to allocate the DiskStore for a spool buffer. Writes are made
+    to this area and then asynchronously written to disk. The default size is 30MB.
+    Each spool buffer is used only by its cache. If you get OutOfMemory errors consider
+    lowering this value. To improve DiskStore performance consider increasing it. Trace level
+    logging in the DiskStore will show if put back ups are occurring.
+
+    clearOnFlush:
+    whether the MemoryStore should be cleared when flush() is called on the cache.
+    By default, this is true i.e. the MemoryStore is cleared.
+
+    memoryStoreEvictionPolicy:
+    Policy would be enforced upon reaching the maxElementsInMemory limit. Default
+    policy is Least Recently Used (specified as LRU). Other policies available -
+    First In First Out (specified as FIFO) and Less Frequently Used
+    (specified as LFU)
+-->
+	<!-- Mandatory Default Cache configuration. These settings will be applied 
+		to caches created programmtically using CacheManager.add(String cacheName). 
+		The defaultCache has an implicit name "default" which is a reserved cache 
+		name. -->
+		
+	<defaultCache maxElementsInMemory="0" eternal="false"
+		overflowToDisk="true" timeToIdleSeconds="1200" timeToLiveSeconds="1200">
+	</defaultCache>
+
+	<!-- Sample cache named sampleCache1 This cache contains a maximum in memory 
+		of 10000 elements, and will expire an element if it is idle for more than 
+		5 minutes and lives for more than 10 minutes. If there are more than 10000 
+		elements it will overflow to the disk cache, which in this configuration 
+		will go to wherever java.io.tmp is defined on your system. On a standard 
+		Linux system this will be /tmp" -->
+	<cache name="groupCache" 
+	       maxElementsInMemory="10000"
+		   maxElementsOnDisk="1000"
+		   eternal="true" 
+		   overflowToDisk="true"
+		   diskSpoolBufferSizeMB="20"
+		   timeToIdleSeconds="300"
+		   timeToLiveSeconds="600"
+		   memoryStoreEvictionPolicy="LFU"
+		   diskPersistent="false" />
+    
+    <cache name="dnCache" 
+	       maxElementsInMemory="10000"
+		   maxElementsOnDisk="1000"
+		   eternal="false" 
+		   overflowToDisk="true"
+		   diskSpoolBufferSizeMB="20"
+		   timeToIdleSeconds="300"
+		   timeToLiveSeconds="600"
+		   memoryStoreEvictionPolicy="LFU" 
+		   diskPersistent="false" />
+		   
 </ehcache>
\ No newline at end of file



Mime
View raw message