Author: asmuts
Date: Tue Aug 30 20:24:08 2005
New Revision: 264930
URL: http://svn.apache.org/viewcvs?rev=264930&view=rev
Log:
added xdocs for bdb and jgroups.
added loggin for bdb.
Added:
jakarta/jcs/trunk/src/conf/cacheBDB.ccf
jakarta/jcs/trunk/xdocs/BDBJEDiskCache.ccf
Modified:
jakarta/jcs/trunk/ (props changed)
jakarta/jcs/trunk/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/disk/bdbje/BDBJE.java
jakarta/jcs/trunk/project.properties
jakarta/jcs/trunk/src/conf/cacheJG1.ccf
jakarta/jcs/trunk/src/conf/cacheJG2.ccf
jakarta/jcs/trunk/src/scripts/prep.bat
jakarta/jcs/trunk/xdocs/navigation.xml
Propchange: jakarta/jcs/trunk/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Aug 30 20:24:08 2005
@@ -1,3 +1,4 @@
+
*~
target
test-reports
@@ -5,3 +6,4 @@
.project
*.log
jars
+junit*.properties
Modified:
jakarta/jcs/trunk/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/disk/bdbje/BDBJE.java
URL:
http://svn.apache.org/viewcvs/jakarta/jcs/trunk/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/disk/bdbje/BDBJE.java?rev=264930&r1=264929&r2=264930&view=diff
==============================================================================
---
jakarta/jcs/trunk/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/disk/bdbje/BDBJE.java
(original)
+++
jakarta/jcs/trunk/auxiliary-builds/jdk14/src/java/org/apache/jcs/auxiliary/disk/bdbje/BDBJE.java
Tue Aug 30 20:24:08 2005
@@ -44,427 +44,424 @@
import com.sleepycat.je.Transaction;
/**
- * All regions share an environment.
- * In this environment each region has a database.
- *
- * As this is implemented JE is extremely slow at getting things
- * to disk, but extremely fast at retrievals. i will experiment
- * with a non-transactional enviroment.
- *
- * To use the je.properties file to configure the Berkeley DB,
- * put it in the environment home directory. It will take
- * precedent over all cache.ccf configurations.
+ * All regions share an environment. In this environment each region has a
+ * database.
+ *
+ * As this is implemented JE is extremely slow at getting things to disk, but
+ * extremely fast at retrievals. i will experiment with a non-transactional
+ * enviroment.
+ *
+ * To use the je.properties file to configure the Berkeley DB, put it in the
+ * environment home directory. It will take precedent over all cache.ccf
+ * configurations.
*/
public class BDBJE
{
- private final static Log log = LogFactory.getLog( BDBJE.class );
+ private final static Log log = LogFactory.getLog( BDBJE.class );
- private File envDir;
+ private File envDir;
- private static Environment coreEnv;
- private static Hashtable databases = new Hashtable();
- private static Database catalogDb;
- private static StoredClassCatalog catalog;
-
- private Database coreDb;
-
- private IBDBJECacheAttributes attributes;
-
- /**
- * Create the cache with the IBDBJECacheAttributes
- */
- public BDBJE( IBDBJECacheAttributes attr )
- {
- attributes = attr;
- // create the directory if it doesn't exist. JE won't do it.
- envDir = new File( attributes.getDiskPath() );
- if ( !envDir.exists() )
- {
- envDir.mkdir();
- }
- init();
- }
+ private static Environment coreEnv;
+
+ private static Hashtable databases = new Hashtable();
+
+ private static Database catalogDb;
- /**
- * This method makes sure that there is a core env defined.
- * A single Environment is shared by all databases.
- */
- private synchronized void verifyCoreEnv()
- {
+ private static StoredClassCatalog catalog;
- if ( coreEnv == null )
+ private Database coreDb;
+
+ private IBDBJECacheAttributes attributes;
+
+ /**
+ * Create the cache with the IBDBJECacheAttributes
+ */
+ public BDBJE( IBDBJECacheAttributes attr )
{
- try
- {
- /* Create a new, transactional database environment */
- EnvironmentConfig envConfig = new EnvironmentConfig();
- envConfig.setTransactional( true );
- // create the env if it doesn't exist, else do nothing
- envConfig.setAllowCreate( true );
-
- if ( this.attributes.getCacheSize() != -1 )
- {
- envConfig.setCacheSize( this.attributes.getCacheSize() );
- if ( log.isDebugEnabled() )
- {
- log.debug( "Set JE CacheSize to '" +
this.attributes.getCacheSize() +
- "'" );
- }
- }
- if ( this.attributes.getCachePercent() != -1 )
- {
- envConfig.setCachePercent( this.attributes.getCachePercent() );
- if ( log.isDebugEnabled() )
- {
- log.debug( "Set JE CachePercent to '" +
- this.attributes.getCachePercent() + "'" );
- }
- }
-
- coreEnv = new Environment( envDir, envConfig );
-
- /*
- * A class catalog database is needed for storing class descriptions
- * for the serial binding used below. This avoids storing class
- * descriptions redundantly in each record.
- */
- Transaction txn = coreEnv.beginTransaction( null, null );
- DatabaseConfig catalogConfig = new DatabaseConfig();
- catalogConfig.setTransactional( true );
- catalogConfig.setAllowCreate( true );
- catalogDb = coreEnv.openDatabase( txn, "catalogDb", catalogConfig );
- catalog = new StoredClassCatalog( catalogDb );
- txn.commit();
- }
- catch ( Exception e )
- {
- log.error( "Problem creating coreEnv", e );
- }
- } // end if
- }
-
- /**
- * Initialize the database for this region.
- */
- private synchronized void init()
- {
- coreDb = ( Database ) databases.get( attributes.getCacheName() );
- if ( coreDb == null )
+ attributes = attr;
+ // create the directory if it doesn't exist. JE won't do it.
+
+ // JE references directories differently. This will not always work.
+ envDir = new File( attributes.getDiskPath() );
+ if ( !envDir.exists() )
+ {
+ if ( log.isInfoEnabled() )
+ {
+ log.info( "Making directory " + attributes.getDiskPath() );
+ }
+ envDir.mkdir();
+ }
+ else
+ {
+ if ( log.isInfoEnabled() )
+ {
+ log.info( "Directory exists: " + attributes.getDiskPath() );
+ }
+ }
+ init();
+ }
+
+ /**
+ * This method makes sure that there is a core env defined. A single
+ * Environment is shared by all databases.
+ */
+ private synchronized void verifyCoreEnv()
{
- verifyCoreEnv();
- try
- {
- /* Make a database within the core environment */
- Transaction txn = coreEnv.beginTransaction( null, null );
- DatabaseConfig dbConfig = new DatabaseConfig();
- dbConfig.setTransactional( true );
- dbConfig.setAllowCreate( true );
- dbConfig.setSortedDuplicates( false );
- // create a database for this region. Aovids the overhead of
- // a secondary database for grouping.
- coreDb =
- coreEnv.openDatabase( txn, attributes.getCacheName(), dbConfig );
- if ( log.isInfoEnabled() )
+ if ( coreEnv == null )
{
- log.info(
- "created db for region = '"
- + attributes.getCacheName()
- + "'" );
- }
- txn.commit();
-
- databases.put( attributes.getCacheName(), coreDb );
- }
- catch ( Exception e )
- {
- log.error( "Problem init", e );
- }
- if ( log.isDebugEnabled() )
- {
- log.debug( "Intitialized BDBJE" );
- }
- }
- } // end init
+ try
+ {
+ /* Create a new, transactional database environment */
+ EnvironmentConfig envConfig = new EnvironmentConfig();
+ envConfig.setTransactional( true );
+ // create the env if it doesn't exist, else do nothing
+ envConfig.setAllowCreate( true );
+
+ if ( this.attributes.getCacheSize() != -1 )
+ {
+ envConfig.setCacheSize( this.attributes.getCacheSize() );
+ if ( log.isDebugEnabled() )
+ {
+ log.debug( "Set JE CacheSize to '" +
this.attributes.getCacheSize() + "'" );
+ }
+ }
+ if ( this.attributes.getCachePercent() != -1 )
+ {
+ envConfig.setCachePercent(
this.attributes.getCachePercent() );
+ if ( log.isDebugEnabled() )
+ {
+ log.debug( "Set JE CachePercent to '" +
this.attributes.getCachePercent() + "'" );
+ }
+ }
- /** Getts an item from the cache. */
- public ICacheElement get( Serializable key ) throws IOException
- {
+ coreEnv = new Environment( envDir, envConfig );
- if ( log.isDebugEnabled() )
+ /*
+ * A class catalog database is needed for storing class
+ * descriptions for the serial binding used below. This avoids
+ * storing class descriptions redundantly in each record.
+ */
+ Transaction txn = coreEnv.beginTransaction( null, null );
+ DatabaseConfig catalogConfig = new DatabaseConfig();
+ catalogConfig.setTransactional( true );
+ catalogConfig.setAllowCreate( true );
+ catalogDb = coreEnv.openDatabase( txn, "catalogDb",
catalogConfig );
+ catalog = new StoredClassCatalog( catalogDb );
+ txn.commit();
+ }
+ catch ( Exception e )
+ {
+ log.error( "Problem creating coreEnv", e );
+ }
+ } // end if
+ }
+
+ /**
+ * Initialize the database for this region.
+ */
+ private synchronized void init()
{
- log.debug( "get key= '" + key + "'" );
- }
+ coreDb = (Database) databases.get( attributes.getCacheName() );
+ if ( coreDb == null )
+ {
+ verifyCoreEnv();
+
+ try
+ {
+ /* Make a database within the core environment */
+ Transaction txn = coreEnv.beginTransaction( null, null );
+ DatabaseConfig dbConfig = new DatabaseConfig();
+ dbConfig.setTransactional( true );
+ dbConfig.setAllowCreate( true );
+ dbConfig.setSortedDuplicates( false );
+ // create a database for this region. Aovids the overhead of
+ // a secondary database for grouping.
+ coreDb = coreEnv.openDatabase( txn, attributes.getCacheName(),
dbConfig );
+ if ( log.isInfoEnabled() )
+ {
+ log.info( "created db for region = '" +
attributes.getCacheName() + "'" );
+ }
+ txn.commit();
- ICacheElement ice = null;
+ databases.put( attributes.getCacheName(), coreDb );
+ }
+ catch ( Exception e )
+ {
+ log.error( "Problem init", e );
+ }
+ if ( log.isDebugEnabled() )
+ {
+ log.debug( "Intitialized BDBJE" );
+ }
+ }
+ } // end init
- try
+ /** Getts an item from the cache. */
+ public ICacheElement get( Serializable key )
+ throws IOException
{
- /* DatabaseEntry represents the key and data of each record */
- DatabaseEntry searchKey = new DatabaseEntry();
- EntryBinding keyBinding =
- new SerialBinding( catalog, key.getClass() );
-
- /*
- * Create a serial binding for MyData data objects. Serial bindings
- * can be used to store any Serializable object.
- */
- EntryBinding dataBinding =
- new SerialBinding( catalog, ICacheElement.class );
- keyBinding.objectToEntry( key, searchKey );
-
- // foundKey and foundData are populated from the primary entry that
- DatabaseEntry foundKey = new DatabaseEntry();
- DatabaseEntry foundData = new DatabaseEntry();
-
- OperationStatus retVal =
- coreDb.get( null, searchKey, foundData, LockMode.DEFAULT );
-
- if ( retVal == OperationStatus.SUCCESS )
- {
- ice = ( ICacheElement ) dataBinding.entryToObject( foundData );
+
if ( log.isDebugEnabled() )
{
- log.debug( "key=" + key + " ice=" + ice );
+ log.debug( "get key= '" + key + "'" );
}
- }
- }
- catch ( Exception e )
- {
- log.error( "Problem updating", e );
- }
- return ice;
- }
- /** Puts a cache item to the cache. */
- public void update( ICacheElement item ) throws IOException
- {
- try
- {
- Transaction txn = coreEnv.beginTransaction( null, null );
- /*
- * Create a serial binding for MyData data objects. Serial bindings
- * can be used to store any Serializable object.
- */
- EntryBinding dataBinding =
- new SerialBinding( catalog, ICacheElement.class );
- EntryBinding keyBinding =
- new SerialBinding( catalog, item.getKey().getClass() );
-
- /* DatabaseEntry represents the key and data of each record */
- DatabaseEntry dataEntry = new DatabaseEntry();
- DatabaseEntry keyEntry = new DatabaseEntry();
-
- dataBinding.objectToEntry( item, dataEntry );
- keyBinding.objectToEntry( item.getKey(), keyEntry );
-
- OperationStatus status = coreDb.put( txn, keyEntry, dataEntry );
-
- if ( log.isDebugEnabled() )
- {
- log.debug(
- "Put key '"
- + item.getKey()
- + "' on disk \n status = '"
- + status
- + "'" );
- }
-
- /*
- * Note that put will throw a DatabaseException when
- * error conditions are found such as deadlock.
- * However, the status return conveys a variety of
- * information. For example, the put might succeed,
- * or it might not succeed if the record exists
- * and duplicates were not
- */
- if ( status != OperationStatus.SUCCESS )
- {
- throw new DatabaseException(
- "Data insertion got status " + status );
- }
- txn.commit();
- }
- catch ( Exception e )
- {
- log.error( e );
- }
- }
-
- /** Removes the given key from the specified cache. */
- public void remove( Serializable key ) throws IOException
- {
- try
- {
- DatabaseEntry searchKey = new DatabaseEntry();
+ ICacheElement ice = null;
- EntryBinding keyBinding =
- new SerialBinding( catalog, key.getClass() );
- keyBinding.objectToEntry( key, searchKey );
-
- coreDb.delete( null, searchKey );
- if ( log.isDebugEnabled() )
- {
- log.debug( "removed, key = '" + key + "'" );
- }
- }
- catch ( Exception e )
- {
- log.error( "Problem removing key = '" + key + "'", e );
+ try
+ {
+ /* DatabaseEntry represents the key and data of each record */
+ DatabaseEntry searchKey = new DatabaseEntry();
+ EntryBinding keyBinding = new SerialBinding( catalog,
key.getClass() );
+
+ /*
+ * Create a serial binding for MyData data objects. Serial bindings
+ * can be used to store any Serializable object.
+ */
+ EntryBinding dataBinding = new SerialBinding( catalog,
ICacheElement.class );
+ keyBinding.objectToEntry( key, searchKey );
+
+ // foundKey and foundData are populated from the primary entry that
+ DatabaseEntry foundKey = new DatabaseEntry();
+ DatabaseEntry foundData = new DatabaseEntry();
+
+ OperationStatus retVal = coreDb.get( null, searchKey, foundData,
LockMode.DEFAULT );
+
+ if ( retVal == OperationStatus.SUCCESS )
+ {
+ ice = (ICacheElement) dataBinding.entryToObject( foundData );
+ if ( log.isDebugEnabled() )
+ {
+ log.debug( "key=" + key + " ice=" + ice );
+ }
+ }
+ }
+ catch ( Exception e )
+ {
+ log.error( "Problem updating", e );
+ }
+ return ice;
}
- }
- /** Remove all keys from the sepcified cache. */
- public void removeAll() throws IOException
- {
- Transaction txn = null;
- try
+ /** Puts a cache item to the cache. */
+ public void update( ICacheElement item )
+ throws IOException
{
- txn = coreEnv.beginTransaction( null, null );
- coreDb.truncate( txn, false );
- }
- catch ( Exception e )
- {
- log.error( e );
+ try
+ {
+ Transaction txn = coreEnv.beginTransaction( null, null );
+ /*
+ * Create a serial binding for MyData data objects. Serial bindings
+ * can be used to store any Serializable object.
+ */
+ EntryBinding dataBinding = new SerialBinding( catalog,
ICacheElement.class );
+ EntryBinding keyBinding = new SerialBinding( catalog,
item.getKey().getClass() );
+
+ /* DatabaseEntry represents the key and data of each record */
+ DatabaseEntry dataEntry = new DatabaseEntry();
+ DatabaseEntry keyEntry = new DatabaseEntry();
+
+ dataBinding.objectToEntry( item, dataEntry );
+ keyBinding.objectToEntry( item.getKey(), keyEntry );
+
+ OperationStatus status = coreDb.put( txn, keyEntry, dataEntry );
+
+ if ( log.isDebugEnabled() )
+ {
+ log.debug( "Put key '" + item.getKey() + "' on disk \n status
= '" + status + "'" );
+ }
+
+ /*
+ * Note that put will throw a DatabaseException when error
+ * conditions are found such as deadlock. However, the status
return
+ * conveys a variety of information. For example, the put might
+ * succeed, or it might not succeed if the record exists and
+ * duplicates were not
+ */
+ if ( status != OperationStatus.SUCCESS )
+ {
+ throw new DatabaseException( "Data insertion got status " +
status );
+ }
+ txn.commit();
+ }
+ catch ( Exception e )
+ {
+ log.error( e );
+ }
}
- finally
+
+ /** Removes the given key from the specified cache. */
+ public void remove( Serializable key )
+ throws IOException
{
- try
- {
- txn.commit();
- }
- catch ( Exception e )
- {
- log.error( e );
- }
- }
+ try
+ {
+ DatabaseEntry searchKey = new DatabaseEntry();
- }
+ EntryBinding keyBinding = new SerialBinding( catalog,
key.getClass() );
+ keyBinding.objectToEntry( key, searchKey );
- /*
- * Closes the database and the environment. Client should do some
- * client checks.
- */
- protected synchronized void dispose()
- {
- if ( log.isInfoEnabled() )
- {
- log.info( "Disposig of region [" + attributes.getCacheName() +
- "], and environment if this is the only region." );
+ coreDb.delete( null, searchKey );
+ if ( log.isDebugEnabled() )
+ {
+ log.debug( "removed, key = '" + key + "'" );
+ }
+ }
+ catch ( Exception e )
+ {
+ log.error( "Problem removing key = '" + key + "'", e );
+ }
}
- if ( coreEnv != null & coreDb != null )
- {
- // close databases
- try
- {
- if ( log.isInfoEnabled() )
+ /** Remove all keys from the sepcified cache. */
+ public void removeAll()
+ throws IOException
+ {
+ Transaction txn = null;
+ try
{
- log.info( this.getDBStats() );
+ txn = coreEnv.beginTransaction( null, null );
+ coreDb.truncate( txn, false );
}
- coreDb.close();
- databases.remove( attributes.getCacheName() );
- }
- catch ( DatabaseException dbe )
- {
- log.error( "Error closing database: " + dbe.toString() );
- }
-
- if ( databases.size() == 0 )
- {
- // close catalog database
- try
+ catch ( Exception e )
{
- catalogDb.close();
+ log.error( e );
}
- catch ( DatabaseException dbe )
+ finally
+ {
+ try
+ {
+ txn.commit();
+ }
+ catch ( Exception e )
+ {
+ log.error( e );
+ }
+ }
+
+ }
+
+ /*
+ * Closes the database and the environment. Client should do some client
+ * checks.
+ */
+ protected synchronized void dispose()
+ {
+ if ( log.isInfoEnabled() )
{
- log.error( "Error closing catalogDB: " + dbe.toString() );
+ log.info( "Disposig of region [" + attributes.getCacheName()
+ + "], and environment if this is the only region." );
}
+ if ( coreEnv != null & coreDb != null )
+ {
- /* // synch env
+ // close databases
+ try
+ {
+ if ( log.isInfoEnabled() )
+ {
+ log.info( this.getDBStats() );
+ }
+ coreDb.close();
+ databases.remove( attributes.getCacheName() );
+ }
+ catch ( DatabaseException dbe )
+ {
+ log.error( "Error closing database: " + dbe.toString() );
+ }
+
+ if ( databases.size() == 0 )
+ {
+ // close catalog database
try
{
- coreEnv.sync();
- if (log.isInfoEnabled()) {
- log.info("Synchronizing coreEnv");
- }
+ catalogDb.close();
}
- catch (DatabaseException dbe) {
- log.error("Error synching coreEnv: " + dbe.toString());
+ catch ( DatabaseException dbe )
+ {
+ log.error( "Error closing catalogDB: " + dbe.toString() );
+ }
+
+ /*
+ * // synch env try { coreEnv.sync(); if (log.isInfoEnabled())
{
+ * log.info("Synchronizing coreEnv"); } } catch
+ * (DatabaseException dbe) { log.error("Error synching
coreEnv: " +
+ * dbe.toString()); }
+ */
+ // close environment
+ try
+ {
+ // Finally, close the environment.
+ if ( log.isInfoEnabled() )
+ {
+ log.info( this.toString() );
+ }
+ coreEnv.close();
+ }
+ catch ( DatabaseException dbe )
+ {
+ log.error( "Error closing coreEnv: " + dbe.toString() );
}
- */
- // close environment
+ }
+ }
+ }
+
+ /*
+ * Returns info about the JE
+ *
+ * @see java.lang.Object#toString()
+ */
+ public String toString()
+ {
+ StringBuffer buf = new StringBuffer();
try
{
- // Finally, close the environment.
- if ( log.isInfoEnabled() )
- {
- log.info( this.toString() );
- }
- coreEnv.close();
+ buf.append( "\n Environment Data:" );
+ EnvironmentStats stats = coreEnv.getStats( new StatsConfig() );
+ buf.append( "\n NCacheMiss: " + stats.getNCacheMiss() );
+ buf.append( "\n CacheTotalBytes: " + stats.getCacheTotalBytes() );
+ buf.append( "\n NCleanerRuns: " + stats.getNCleanerRuns() );
+ buf.append( "\n -------------------------------------" );
+ buf.append( "\n Other Databases in this Environment:" );
+ List myDbNames = coreEnv.getDatabaseNames();
+ for ( int i = 0; i < myDbNames.size(); i++ )
+ {
+ buf.append( "\n Database Name: " + (String) myDbNames.get( i )
);
+ }
}
catch ( DatabaseException dbe )
{
- log.error( "Error closing coreEnv: " + dbe.toString() );
+ log.error( "Error getting toString()" + dbe.toString() );
}
- }
- }
- }
-
- /*
- * Returns info about the JE
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- StringBuffer buf = new StringBuffer();
- try
- {
- buf.append( "\n Environment Data:" );
- EnvironmentStats stats = coreEnv.getStats( new StatsConfig() );
- buf.append( "\n NCacheMiss: " + stats.getNCacheMiss() );
- buf.append( "\n CacheTotalBytes: " + stats.getCacheTotalBytes() );
- buf.append( "\n NCleanerRuns: " + stats.getNCleanerRuns() );
- buf.append( "\n -------------------------------------" );
- buf.append( "\n Other Databases in this Environment:" );
- List myDbNames = coreEnv.getDatabaseNames();
- for ( int i = 0; i < myDbNames.size(); i++ )
- {
- buf.append( "\n Database Name: " + ( String ) myDbNames.get( i ) );
- }
- }
- catch ( DatabaseException dbe )
- {
- log.error( "Error getting toString()" + dbe.toString() );
+ return buf.toString();
}
- return buf.toString();
- }
- /**
- * Gets the stats for this db.
- * @return
- */
- public String getDBStats()
- {
- StringBuffer buf = new StringBuffer();
- try
- {
- DatabaseStats stats = coreDb.getStats( new StatsConfig() );
- buf.append( "\n This database name: " + coreDb.getDatabaseName() );
- buf.append( "\n This database stats: " );
- buf.append( "\n BinCount: " + stats.getBinCount() );
- buf.append( "\n DeletedLNCount: " + stats.getDeletedLNCount() );
- buf.append( "\n DupCountLNCount: " + stats.getDupCountLNCount() );
- buf.append( "\n InCount: " + stats.getInCount() );
- buf.append( "\n LnCount: " + stats.getLnCount() );
- buf.append( "\n MaxDepth: " + stats.getMaxDepth() );
- }
- catch ( DatabaseException dbe )
+ /**
+ * Gets the stats for this db.
+ *
+ * @return
+ */
+ public String getDBStats()
{
- log.error( "Error getting stats" + dbe.toString() );
+ StringBuffer buf = new StringBuffer();
+ try
+ {
+ DatabaseStats stats = coreDb.getStats( new StatsConfig() );
+ buf.append( "\n This database name: " + coreDb.getDatabaseName() );
+ buf.append( "\n This database stats: " );
+ buf.append( "\n BinCount: " + stats.getBinCount() );
+ buf.append( "\n DeletedLNCount: " + stats.getDeletedLNCount() );
+ buf.append( "\n DupCountLNCount: " + stats.getDupCountLNCount() );
+ buf.append( "\n InCount: " + stats.getInCount() );
+ buf.append( "\n LnCount: " + stats.getLnCount() );
+ buf.append( "\n MaxDepth: " + stats.getMaxDepth() );
+ }
+ catch ( DatabaseException dbe )
+ {
+ log.error( "Error getting stats" + dbe.toString() );
+ }
+ return buf.toString();
}
- return buf.toString();
- }
}
Modified: jakarta/jcs/trunk/project.properties
URL:
http://svn.apache.org/viewcvs/jakarta/jcs/trunk/project.properties?rev=264930&r1=264929&r2=264930&view=diff
==============================================================================
--- jakarta/jcs/trunk/project.properties (original)
+++ jakarta/jcs/trunk/project.properties Tue Aug 30 20:24:08 2005
@@ -31,3 +31,8 @@
# C H E C K S T Y L E P R O P E R T I E S
# -------------------------------------------------------------------
maven.checkstyle.properties = ${basedir}/checkstyle.xml
+
+# -------------------------------------------------------------------
+# C H A N G E L O G P R O P E R T I E S
+# -------------------------------------------------------------------
+maven.changelog.range=360
Added: jakarta/jcs/trunk/src/conf/cacheBDB.ccf
URL:
http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/conf/cacheBDB.ccf?rev=264930&view=auto
==============================================================================
--- jakarta/jcs/trunk/src/conf/cacheBDB.ccf (added)
+++ jakarta/jcs/trunk/src/conf/cacheBDB.ccf Tue Aug 30 20:24:08 2005
@@ -0,0 +1,39 @@
+# Cache configuration for the 'TestDiskCache' test. The memory cache has a
+# a maximum of 100 objects, so objects should get pushed into the disk cache
+
+jcs.default=bdbje
+jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
+jcs.default.cacheattributes.MaxObjects=100
+jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
+
+##### CACHE REGIONS FOR TEST
+
+jcs.region.indexedRegion1=bdbje
+jcs.region.indexedRegion1.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
+jcs.region.indexedRegion1.cacheattributes.MaxObjects=100
+jcs.region.indexedRegion1.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
+
+jcs.region.indexedRegion2=bdbje
+jcs.region.indexedRegion2.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
+jcs.region.indexedRegion2.cacheattributes.MaxObjects=100
+jcs.region.indexedRegion2.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
+
+jcs.region.indexedRegion3=bdbje
+jcs.region.indexedRegion3.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
+jcs.region.indexedRegion3.cacheattributes.MaxObjects=100
+jcs.region.indexedRegion3.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
+
+jcs.region.indexedRegion4=bdbje
+jcs.region.indexedRegion4.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
+jcs.region.indexedRegion4.cacheattributes.MaxObjects=100
+jcs.region.indexedRegion4.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
+jcs.region.indexedRegion4.cacheattributes.UseMemoryShrinker=false
+
+
+##### AUXILIARY CACHES
+
+# Berkeley DB JE
+jcs.auxiliary.bdbje=org.apache.jcs.auxiliary.disk.bdbje.BDBJECacheFactory
+jcs.auxiliary.bdbje.attributes=org.apache.jcs.auxiliary.disk.bdbje.BDBJECacheAttributes
+jcs.auxiliary.bdbje.attributes.DiskPath=target/
+jcs.auxiliary.bdbje.attributes.MaxPurgatorySize=100000
\ No newline at end of file
Modified: jakarta/jcs/trunk/src/conf/cacheJG1.ccf
URL:
http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/conf/cacheJG1.ccf?rev=264930&r1=264929&r2=264930&view=diff
==============================================================================
Binary files - no diff available.
Modified: jakarta/jcs/trunk/src/conf/cacheJG2.ccf
URL:
http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/conf/cacheJG2.ccf?rev=264930&r1=264929&r2=264930&view=diff
==============================================================================
Binary files - no diff available.
Modified: jakarta/jcs/trunk/src/scripts/prep.bat
URL:
http://svn.apache.org/viewcvs/jakarta/jcs/trunk/src/scripts/prep.bat?rev=264930&r1=264929&r2=264930&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/scripts/prep.bat (original)
+++ jakarta/jcs/trunk/src/scripts/prep.bat Tue Aug 30 20:24:08 2005
@@ -19,6 +19,7 @@
set CLASSPATH=%CLASSPATH%;%CURDIR%\src\conf\
set CLASSPATH=%CLASSPATH%;%CURDIR%\target\classes\
set CLASSPATH=%CLASSPATH%;%CURDIR%\target\test-classes\
+set CLASSPATH=%CLASSPATH%;%CURDIR%\auxiliary-builds\jdk14\target\classes\
goto jars
:jars
Added: jakarta/jcs/trunk/xdocs/BDBJEDiskCache.ccf
URL:
http://svn.apache.org/viewcvs/jakarta/jcs/trunk/xdocs/BDBJEDiskCache.ccf?rev=264930&view=auto
==============================================================================
--- jakarta/jcs/trunk/xdocs/BDBJEDiskCache.ccf (added)
+++ jakarta/jcs/trunk/xdocs/BDBJEDiskCache.ccf Tue Aug 30 20:24:08 2005
@@ -0,0 +1,68 @@
+<?xml version="1.0"?>
+
+<document>
+ <properties>
+ <title>Berkeley DB Disk Auxiliary Cache</title>
+ <author email="[EMAIL PROTECTED]">Aaron Smuts</author>
+ </properties>
+
+ <body>
+ <section name="Berkeley DB Disk Auxiliary Cache">
+ <p>
+ The Berkeley DB Disk Auxiliary Cache is an optional plugin for the
+ JCS. It is primarily intended to provide a secondary store to
+ ease the memory burden of the cache. When the memory cache
+ exceeds its maximum size it tells the cache hub that the item
+ to be removed from memory should be spooled to disk. The cache
+ checks to see if any auxiliaries of type "disk" have been
+ configured for the region. If the "Berkeley DB Disk Auxiliary
Cache"
+ is used, the item will be spooled to disk.
+ </p>
+ <p>
+ The Berkeley DB is far slower than the Indexed Disk Cache,
especially for puts.
+ This is partially due to the fact that the BDB store its keys
on disk.
+ However, any items stored in the BDB will be available on
restart, even if
+ the cache is not shutdown properly.
+ </p>
+ <p>
+ The Berkeley DB requires jdk1.4 and above. As such, it is
distributed
+ in the jdk14-ext jar.
+ </p>
+
+ <subsection name="Configuration">
+ <p>
+ The simple configuration and is done in the auxiliary
+ cache section of the <code>cache.ccf</code> configuration file.
+ In the example below, I created a Berkeley DB Auxiliary Cache
+ referenced by <code>BDBDC</code>. It uses files located in the
+ "DiskPath" directory.
+ </p>
+
+ <source><![CDATA[
+##############################################################
+##### Default Region Configuration
+jcs.default=BDBDC
+jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
+jcs.default.cacheattributes.MaxObjects=100
+jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
+
+##############################################################
+##### CACHE REGIONS
+jcs.region.myRegion1=BDBDC
+jcs.region.myRegion1.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
+jcs.region.myRegion1.cacheattributes.MaxObjects=1000
+jcs.region.myRegion1.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
+
+##############################################################
+##### AUXILIARY CACHES
+# Berkeley DB JE
+jcs.auxiliary.BDBDC=org.apache.jcs.auxiliary.disk.bdbje.BDBJECacheFactory
+jcs.auxiliary.BDBDC.attributes=org.apache.jcs.auxiliary.disk.bdbje.BDBJECacheAttributes
+jcs.auxiliary.BDBDC.attributes.DiskPath=target/
+jcs.auxiliary.BDBDC.attributes.MaxPurgatorySize=100000
+ ]]></source>
+ </subsection>
+
+ </section>
+ </body>
+</document>
\ No newline at end of file
Modified: jakarta/jcs/trunk/xdocs/navigation.xml
URL:
http://svn.apache.org/viewcvs/jakarta/jcs/trunk/xdocs/navigation.xml?rev=264930&r1=264929&r2=264930&view=diff
==============================================================================
--- jakarta/jcs/trunk/xdocs/navigation.xml (original)
+++ jakarta/jcs/trunk/xdocs/navigation.xml Tue Aug 30 20:24:08 2005
@@ -18,16 +18,18 @@
<menu name="JCS User's Guide">
<item name="Basic JCS Config"
href="/BasicJCSConfiguration.html"/>
<item name="Element Config" href="/ElementAttributes.html"/>
- <item name="Region Properties" href="/RegionProperties.html"/>
+ <item name="Region Properties" href="/RegionProperties.html"/>
<item name="Basic Web Example" href="/UsingJCSBasicWeb.html"/>
<item name="Plugin Overview" href="/Plugins.html"/>
<item name="Local Cache" href="/LocalCacheConfig.html"/>
<item name="Indexed Disk Cache" href="/IndexedDiskAuxCache.html"/>
<item name="Indexed Disk Properties"
href="/IndexedDiskCacheProperties.html"/>
+ <item name="Berkeley DB Disk Cache" href="/BDBJEDiskCache.html"/>
<item name="Remote Cache" href="/RemoteAuxCache.html"/>
<item name="Lateral TCP Cache" href="/LateralTCPAuxCache.html"/>
<item name="Lateral TCP Properties" href="/LateralTCPProperties.html"/>
<item name="Lateral UDP Discovery" href="/LateralUDPDiscovery.html"/>
+ <item name="Lateral JGroups Cache"
href="/LateralJavaGroupsAuxCache.html"/>
</menu>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]