db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r600457 - in /db/derby/code/trunk/java/engine/org/apache/derby: iapi/store/raw/data/DataFactory.java impl/store/raw/data/BaseDataFileFactory.java impl/store/raw/log/LogToFile.java
Date Mon, 03 Dec 2007 09:28:04 GMT
Author: kahatlen
Date: Mon Dec  3 01:28:02 2007
New Revision: 600457

URL: http://svn.apache.org/viewvc?rev=600457&view=rev
Log:
DERBY-3131: Background cleaner has no daemon service after database creation

Give the page cache and the container cache a background cleaner also
when no recovery was performed during database boot.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/data/DataFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/data/DataFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/data/DataFactory.java?rev=600457&r1=600456&r2=600457&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/data/DataFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/data/DataFactory.java
Mon Dec  3 01:28:02 2007
@@ -23,6 +23,7 @@
 
 import org.apache.derby.iapi.store.raw.ContainerKey;
 
+import org.apache.derby.iapi.services.daemon.DaemonService;
 import org.apache.derby.iapi.services.daemon.Serviceable;
 import org.apache.derby.iapi.services.context.ContextManager;
 
@@ -252,6 +253,14 @@
 		@exception StandardException Standard Derby Error Policy
 	*/
 	public void postRecovery() throws StandardException;
+
+    /**
+     * Set up the data factory's caches to use the specified daemon service for
+     * background cleaning.
+     *
+     * @param daemon daemon service to use for background cleaning
+     */
+    public void setupCacheCleaner(DaemonService daemon);
 
 	/**
 		Encrypt cleartext into ciphertext.

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java?rev=600457&r1=600456&r2=600457&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java
Mon Dec  3 01:28:02 2007
@@ -2222,15 +2222,11 @@
 	public void postRecovery() throws StandardException 
     {
 
-		// hook up the cache cleaner daemon after recovery is finished
 		DaemonService daemon = rawStoreFactory.getDaemon();
 
 		if (daemon == null)
 			return;
 
-		containerCache.useDaemonService(daemon);
-
-		pageCache.useDaemonService(daemon);
 		if (postRecoveryRemovedFiles != null) 
         {
             synchronized( this)
@@ -2248,6 +2244,14 @@
 			postRecoveryRemovedFiles = null;
 		}
 	}
+
+    /**
+     * Set up the cache cleaner for the container cache and the page cache.
+     */
+    public void setupCacheCleaner(DaemonService daemon) {
+        containerCache.useDaemonService(daemon);
+        pageCache.useDaemonService(daemon);
+    }
 
 	public void freezePersistentStore() throws StandardException
 	{

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java?rev=600457&r1=600456&r2=600457&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java Mon
Dec  3 01:28:02 2007
@@ -1340,13 +1340,16 @@
         // done with recovery        
         
 		/////////////////////////////////////////////////////////////
-		// setup checktpoint daemon
+		// setup checkpoint daemon and cache cleaner
 		/////////////////////////////////////////////////////////////
 		checkpointDaemon = rawStoreFactory.getDaemon();
 		if (checkpointDaemon != null)
         {
 			myClientNumber =
                 checkpointDaemon.subscribe(this, true /*onDemandOnly */);
+
+            // use the same daemon for the cache cleaner
+            dataFactory.setupCacheCleaner(checkpointDaemon);
         }
 	}
 



Mime
View raw message