db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject svn commit: r671639 - in /db/derby/code/branches/10.3/java/engine/org/apache/derby: iapi/store/raw/RawStoreFactory.java impl/store/raw/data/BaseDataFileFactory.java
Date Wed, 25 Jun 2008 19:03:56 GMT
Author: mikem
Date: Wed Jun 25 12:03:56 2008
New Revision: 671639

URL: http://svn.apache.org/viewvc?rev=671639&view=rev
Log:
DERBY-3734

backporting fix from trunk (revision 671240), to 10.3 branch.

Changing the undocumented property derby.storage.fileCacheSize to allow
any maximum setting, previously it limited the setting to a maximum of 100.


Modified:
    db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/store/raw/RawStoreFactory.java
    db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/store/raw/RawStoreFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/store/raw/RawStoreFactory.java?rev=671639&r1=671638&r2=671639&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/store/raw/RawStoreFactory.java
(original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/iapi/store/raw/RawStoreFactory.java
Wed Jun 25 12:03:56 2008
@@ -147,11 +147,62 @@
 	*/
 	public static final int PAGE_CACHE_SIZE_MAXIMUM = Integer.MAX_VALUE;
 
+
+	/** Property name for the number of open files to maintain associated with
+        the page cache.  Internally this is referred to as the "ContainerCache".
+
+        Each object in this cache maps to a java level "open" file on a file
+        in the database directory.  Although actual implementation depends on
+        JVM implementation, this usually maps to underlying open file resources
+        in the underlying operating system.  Setting this number too high
+        may result in I/O failures reported by Derby, which are the result 
+        of hitting some user and/or OS limit on the number of open files
+        allowed.  These I/O errors may happen during read, write and/or open 
+        operations.  
+        Sometimes these limits can be avoided simply by executing an OS 
+        specific command to raise the maximum open files allowed by whatever
+        mechanism is used to control resources allowed to be consumed by
+        the JVM.
+
+        Derby may also open other files separate from this cache, so exausting
+        the open file resource may cause other operations than I/O to data
+        pages to fail.  A partial list of these operations includes: 
+        recovery logging, error logging, external sorting, and 
+        LOB disk overflow.
+
+        The default maximum size of this cache is 100 open files.
+        The minimum size of this cache is 2 open files, attempting to set this
+        cache to a smaller size or a negative number will result in a size 2
+        cache.  Setting the cache size to a number bigger than an INT, or any
+        sort of illegal format number will result in a cache size of 100
+        open files.
+
+        Equal to 'derby.storage.fileCacheSize'
+	*/
+	public static final String CONTAINER_CACHE_SIZE_PARAMETER = 
+        "derby.storage.fileCacheSize";
+
+	/**
+		Default value for CONTAINER_CACHE_SIZE_PARAMETER (100).
+	*/
+	public static final int CONTAINER_CACHE_SIZE_DEFAULT = 100;
+
+	/**
+		Minimum container cache size accepted (2).
+	*/
+	public static final int CONTAINER_CACHE_SIZE_MINIMUM = 2;
+
+	/**
+		Maximum container cache size we will accept (MAXINT).
+	*/
+	public static final int CONTAINER_CACHE_SIZE_MAXIMUM = Integer.MAX_VALUE;
+
 	/**
 		Maximum number of initial pages when a container is created
 	*/
 	public static final short MAX_CONTAINER_INITIAL_PAGES = 1000;
 
+
 	/** Property name for the default minimum record size to be used in the 
         storage area. Minimum record size is the minimum number of bytes that a 
         record will reserve on disk.

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java?rev=671639&r1=671638&r2=671639&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java
(original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java
Wed Jun 25 12:03:56 2008
@@ -377,6 +377,7 @@
             Monitor.startSystemModule(
                 org.apache.derby.iapi.reference.Module.CacheFactory);
 
+        // Initialize the page cache
 	    int pageCacheSize = getIntParameter(
 					RawStoreFactory.PAGE_CACHE_SIZE_PARAMETER,
                     null,
@@ -385,17 +386,16 @@
                     RawStoreFactory.PAGE_CACHE_SIZE_MAXIMUM);
 
 		pageCache =
-				cf.newCacheManager(this,
-                    "PageCache",
-                    pageCacheSize / 2,
-                    pageCacheSize);
+            cf.newCacheManager(
+                this, "PageCache", pageCacheSize / 2, pageCacheSize);
 
+        // Initialize the container cache
 	    int fileCacheSize = getIntParameter(
-					"derby.storage.fileCacheSize",
+                    RawStoreFactory.CONTAINER_CACHE_SIZE_PARAMETER,
                     null,
-                    100,
-                    2,
-                    100);
+                    RawStoreFactory.CONTAINER_CACHE_SIZE_DEFAULT,
+                    RawStoreFactory.CONTAINER_CACHE_SIZE_MINIMUM,
+                    RawStoreFactory.CONTAINER_CACHE_SIZE_MAXIMUM);
 
 		containerCache = 
             cf.newCacheManager(
@@ -408,7 +408,6 @@
 
 			inCreateNoLog = 
                 (noLog != null && Boolean.valueOf(noLog).booleanValue());
-
 		}
 
 		freezeSemaphore = new Object();



Mime
View raw message