I'm sure there are problems with both JISP and HSQL.  They are actually
just first attempts.  JISP has the most potential and should be
finished.  HSQL might become a generic JDBC auxiliary.  The performance
was so bad and I wanted the Indexed disk to be better, so I never really
did any finishing work on either.  There shouldn't be too much left to
do with JISP though.  One problem is that it doesn't seem to load the
old file on startup.

I'm going to refactor the lateral a bit and add javagroups now.

Aaron  

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, February 23, 2002 3:39 PM
> To: [EMAIL PROTECTED]
> Subject: cvs commit: jakarta-turbine-stratum/src/test-conf
> TestDiskCache.ccf
> 
> jtaylor     02/02/23 12:39:11
> 
>   Modified:    .        build-test.xml
>                src/java/org/apache/stratum/jcs/auxiliary/disk/hsql
>                         HSQLCache.java HSQLCacheManager.java
>                src/java/org/apache/stratum/jcs/auxiliary/disk/indexed
>                         IndexedDiskLockManager.java
>                src/java/org/apache/stratum/jcs/auxiliary/disk/jisp
>                         JISPCacheManager.java JISPKey.java
>                src/test/org/apache/stratum/jcs TestDiskCache.java
>                src/test-conf TestDiskCache.ccf
>   Log:
>   Added to TestDiskCache unit test to have it test the Indexed, JISP,
and
> HSQL
>   caches. This was meant as a first step (or safety net if you will)
for
> starting
>   to refactor the disk caches. However it appears that neither the
JISP or
> HSQL
>   caches work quite right in their current form. I'll continue to look
at
> this
>   but if someone else (Aaron) has some insight that would be great.
> 
>   Revision  Changes    Path
>   1.9       +1 -1      jakarta-turbine-stratum/build-test.xml
> 
>   Index: build-test.xml
>   ===================================================================
>   RCS file: /home/cvs/jakarta-turbine-stratum/build-test.xml,v
>   retrieving revision 1.8
>   retrieving revision 1.9
>   diff -u -r1.8 -r1.9
>   --- build-test.xml  16 Feb 2002 22:30:16 -0000      1.8
>   +++ build-test.xml  23 Feb 2002 20:39:11 -0000      1.9
>   @@ -1,6 +1,6 @@
>    <?xml version="1.0"?>
> 
>   -<project name="Stratum" default="test" basedir=".">
>   +<project name="Stratum Tests" default="test" basedir=".">
> 
>      <!-- Allow any user specific values to override the defaults -->
>      <property file="${user.home}/build.properties" />
> 
> 
> 
>   1.9       +3 -5      jakarta-turbine-
>
stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/hsql/HSQLCache.ja
va
> 
>   Index: HSQLCache.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-turbine-
>
stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/hsql/HSQLCache.ja
va
> ,v
>   retrieving revision 1.8
>   retrieving revision 1.9
>   diff -u -r1.8 -r1.9
>   --- HSQLCache.java  18 Feb 2002 17:14:23 -0000      1.8
>   +++ HSQLCache.java  23 Feb 2002 20:39:11 -0000      1.9
>   @@ -266,7 +266,7 @@
>                {
>                    newT = false;
>                }
>   -            System.out.println( "Exception: " + e );
>   +            log.error( e );
>            }
> 
>            String setupData[] = {
>   @@ -398,8 +398,6 @@
>                log.error( e );
>            }
> 
>   -        System.out.println( "exists = " + exists );
>   -
>            if ( !exists )
>            {
> 
>   @@ -439,7 +437,7 @@
>                    psUpdate.execute();
>                    psUpdate.close();
>                    //sStatement.executeUpdate(sql);
>   -                System.out.println( "ran update" );
>   +                log.debug( "ran update" );
>                }
>                catch ( SQLException e2 )
>                {
>   @@ -634,7 +632,7 @@
>                }
>                catch ( SQLException e )
>                {
>   -                System.out.println( "Exception: " + e );
>   +                log.error( e );
>                }
> 
>            }
> 
> 
> 
>   1.7       +5 -2      jakarta-turbine-
>
stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/hsql/HSQLCacheMan
ag
> er.java
> 
>   Index: HSQLCacheManager.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-turbine-
>
stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/hsql/HSQLCacheMan
ag
> er.java,v
>   retrieving revision 1.6
>   retrieving revision 1.7
>   diff -u -r1.6 -r1.7
>   --- HSQLCacheManager.java   16 Feb 2002 02:37:18 -0000      1.6
>   +++ HSQLCacheManager.java   23 Feb 2002 20:39:11 -0000      1.7
>   @@ -200,12 +200,15 @@
> 
>            while ( allCaches.hasMoreElements() )
>            {
>   -            HSQLCache raf = ( HSQLCache ) allCaches.nextElement();
>   +            ICache raf = ( ICache ) allCaches.nextElement();
>   +
>                if ( raf != null )
>                {
>   -                stats.append( "<br>&nbsp;&nbsp;&nbsp;" +
raf.getStats()
> );
>   +                stats.append( raf.getStats() );
>   +                stats.append( ", " );
>                }
>            }
>   +
>            return stats.toString();
>        }
> 
> 
> 
> 
>   1.2       +0 -1      jakarta-turbine-
>
stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/indexed/IndexedDi
sk
> LockManager.java
> 
>   Index: IndexedDiskLockManager.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-turbine-
>
stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/indexed/IndexedDi
sk
> LockManager.java,v
>   retrieving revision 1.1
>   retrieving revision 1.2
>   diff -u -r1.1 -r1.2
>   --- IndexedDiskLockManager.java     17 Feb 2002 06:59:19 -0000
1.1
>   +++ IndexedDiskLockManager.java     23 Feb 2002 20:39:11 -0000
1.2
>   @@ -75,7 +75,6 @@
> 
>        private final Hashtable ht = new Hashtable();
> 
>   -
>        /**
>         * Constructor for the DiskLockManager object
>         */
> 
> 
> 
>   1.6       +5 -2      jakarta-turbine-
>
stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/jisp/JISPCacheMan
ag
> er.java
> 
>   Index: JISPCacheManager.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-turbine-
>
stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/jisp/JISPCacheMan
ag
> er.java,v
>   retrieving revision 1.5
>   retrieving revision 1.6
>   diff -u -r1.5 -r1.6
>   --- JISPCacheManager.java   16 Feb 2002 02:37:18 -0000      1.5
>   +++ JISPCacheManager.java   23 Feb 2002 20:39:11 -0000      1.6
>   @@ -154,12 +154,15 @@
> 
>            while ( allCaches.hasMoreElements() )
>            {
>   -            JISPCache raf = ( JISPCache ) allCaches.nextElement();
>   +            ICache raf = ( ICache ) allCaches.nextElement();
>   +
>                if ( raf != null )
>                {
>   -                stats.append( "<br>&nbsp;&nbsp;&nbsp;" +
raf.getStats()
> );
>   +                stats.append( raf.getStats() );
>   +                stats.append( ", " );
>                }
>            }
>   +
>            return stats.toString();
>        }
> 
> 
> 
> 
>   1.7       +3 -12     jakarta-turbine-
>
stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/jisp/JISPKey.java
> 
>   Index: JISPKey.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-turbine-
>
stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/jisp/JISPKey.java
,v
>   retrieving revision 1.6
>   retrieving revision 1.7
>   diff -u -r1.6 -r1.7
>   --- JISPKey.java    16 Feb 2002 02:37:18 -0000      1.6
>   +++ JISPKey.java    23 Feb 2002 20:39:11 -0000      1.7
>   @@ -60,10 +60,7 @@
>                //int orig = ( ( JISPKey ) key ).m_key.hashCode();
>                int orig = m_key.hashCode();
>                int test = key.hashCode();
>   -            if ( log.isDebugEnabled() )
>   -            {
>   -                log.debug( "orig = " + orig + ", test = " + test );
>   -            }
>   +
>                int cv = test - orig;
>                if ( cv == 0 )
>                {
>   @@ -140,10 +137,7 @@
>            {
>                int orig = m_key.hashCode();
>                int test = ( ( JISPKey ) obj ).m_key.hashCode();
>   -            if ( log.isDebugEnabled() )
>   -            {
>   -                log.debug( "orig = " + orig + ", test = " + test );
>   -            }
>   +
>                return ( orig == test );
>                //return ( m_key.equals( ( ( JISPKey ) obj ).m_key ) );
>            }
>   @@ -158,10 +152,7 @@
>        public int hashCode()
>        {
>            int hash = m_key.hashCode();
>   -        if ( log.isDebugEnabled() )
>   -        {
>   -            log.debug( "hash = " + hash );
>   -        }
>   +
>            return hash;
>            // new Integer(m_key).hashCode();
>        }
> 
> 
> 
>   1.2       +40 -10    jakarta-turbine-
> stratum/src/test/org/apache/stratum/jcs/TestDiskCache.java
> 
>   Index: TestDiskCache.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-turbine-
> stratum/src/test/org/apache/stratum/jcs/TestDiskCache.java,v
>   retrieving revision 1.1
>   retrieving revision 1.2
>   diff -u -r1.1 -r1.2
>   --- TestDiskCache.java      16 Feb 2002 21:59:33 -0000      1.1
>   +++ TestDiskCache.java      23 Feb 2002 20:39:11 -0000      1.2
>   @@ -63,24 +63,27 @@
>    import
> org.apache.stratum.jcs.engine.behavior.ICompositeCacheAttributes;
> 
>    /**
>   - * Test which excercises the disk cache.
>   + * Test which excercises the disk caches (Indexed, JISP, and HSQL).
>     *
>   - * @author <a href="mailto:[EMAIL PROTECTED]";>Aaron Smuts</a>
>   + * @author <a href="mailto:[EMAIL PROTECTED]";>James Taylor</a>
>   + * @version $Id: TestDiskCache.java,v 1.2 2002/02/23 20:39:11
jtaylor
> Exp $
>     */
>    public class TestDiskCache extends TestCase
>    {
>        /**
>         * Number of items to cache, twice the configured maxObjects
for
> the
>   -     * memory cache
>   +     * memory cache regions.
>         */
>        private static int items = 200;
> 
>        /**
>   -     * Constructor for the TestSimpleLoad object
>   +     * Constructor for the TestDiskCache object.
>         */
>        public TestDiskCache( String testName )
>        {
>            super( testName );
>   +
>   +        JCS.setConfigFilename( "/TestDiskCache.ccf" );
>        }
> 
>        /**
>   @@ -102,18 +105,45 @@
>            return new TestSuite( TestDiskCache.class );
>        }
> 
>   +    /**
>   +     * Tests the region which uses the indexed disk cache
>   +     */
>   +    public void testIndexedDiskCache()
>   +        throws Exception
>   +    {
>   +        runTestForRegion( "indexedRegion" );
>   +    }
>   +
>   +    /**
>   +     * Tests the region which uses the JISP disk cache
>   +     */
>   +    public void testJISPDiskCache()
>   +        throws Exception
>   +    {
>   +        runTestForRegion( "jispRegion" );
>   +    }
>   +
>   +    /**
>   +     * Tests the region which uses the HSQL disk cache
>   +     */
>   +    public void testHSQLDiskCache()
>   +        throws Exception
>   +    {
>   +        runTestForRegion( "hsqlRegion" );
>   +    }
>   +
>        /**
>         * Adds items to cache, gets them, and removes them. The item
count
> is more
>   -     * than
>   +     * than the size of the memory cache, so items should spool to
> disk.
>         *
>   -     * @exception  Exception  Description of the Exception
>   +     * @param region Name of the region to access
>   +     *
>   +     * @exception Exception If an error occurs
>         */
>   -    public void testDiskCache()
>   +    public void runTestForRegion( String region )
>            throws Exception
>        {
>   -        JCS.setConfigFilename( "/TestDiskCache.ccf" );
>   -
>   -        JCS jcs = JCS.getInstance( "testCache" );
>   +        JCS jcs = JCS.getInstance( region );
> 
>            // Add items to cache
> 
> 
> 
> 
>   1.2       +38 -16    jakarta-turbine-stratum/src/test-
> conf/TestDiskCache.ccf
> 
>   Index: TestDiskCache.ccf
>   ===================================================================
>   RCS file: /home/cvs/jakarta-turbine-stratum/src/test-
> conf/TestDiskCache.ccf,v
>   retrieving revision 1.1
>   retrieving revision 1.2
>   diff -u -r1.1 -r1.2
>   --- TestDiskCache.ccf       16 Feb 2002 21:59:33 -0000      1.1
>   +++ TestDiskCache.ccf       23 Feb 2002 20:39:11 -0000      1.2
>   @@ -1,27 +1,49 @@
>    # 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=DC
>   +jcs.default=indexedDiskCache
> 
>
jcs.default.cacheattributes=org.apache.stratum.jcs.engine.CompositeCache
At
> tributes
>   -jcs.default.cacheattributes.MaxObjects=1000
>   +jcs.default.cacheattributes.MaxObjects=100
> 
>
jcs.default.cacheattributes.MemoryCacheName=org.apache.stratum.jcs.engin
e.
> memory.lru.LRUMemoryCache
> 
>    # SYSTEM GROUP ID CACHE
>   -jcs.system.groupIdCache=DC
>   +jcs.system.groupIdCache=indexedDiskCache
> 
>
jcs.system.groupIdCache.cacheattributes=org.apache.stratum.jcs.engine.Co
mp
> ositeCacheAttributes
>    jcs.system.groupIdCache.cacheattributes.MaxObjects=10000
> 
>
jcs.system.groupIdCache.cacheattributes.MemoryCacheName=org.apache.strat
um
> .jcs.engine.memory.lru.LRUMemoryCache
>   -
> 
>   -# CACHE REGIONS AVAILABLE
>   -jcs.region.testCache=DC
>   -
>
jcs.region.testCache.cacheattributes=org.apache.stratum.jcs.engine.Compo
si
> teCacheAttributes
>   -jcs.region.testCache.cacheattributes.MaxObjects=100
>   -
>
jcs.region.testCache.cacheattributes.MemoryCacheName=org.apache.stratum.
jc
> s.engine.memory.lru.LRUMemoryCache
>   -
>   -# AUXILIARY CACHES AVAILABLE
>   -
>   -# Primary Disk Cache-- faster than the rest because of memory key
> storage
>
-jcs.auxiliary.DC=org.apache.stratum.jcs.auxiliary.disk.DiskCacheFactory
>   -
>
jcs.auxiliary.DC.attributes=org.apache.stratum.jcs.auxiliary.disk.DiskCa
ch
> eAttributes
>   -jcs.auxiliary.DC.attributes.DiskPath=bin/test/disk-cache
>   +
>   +##### CACHE REGIONS FOR TEST
>   +
>   +jcs.region.indexedRegion=indexedDiskCache
> 
>
+jcs.region.indexedRegion.cacheattributes=org.apache.stratum.jcs.engine.
Co
> mpositeCacheAttributes
>   +jcs.region.indexedRegion.cacheattributes.MaxObjects=100
> 
>
+jcs.region.indexedRegion.cacheattributes.MemoryCacheName=org.apache.str
at
> um.jcs.engine.memory.lru.LRUMemoryCache
>   +
>   +jcs.region.hsqlRegion=hsqlDiskCache
> 
>
+jcs.region.hsqlRegion.cacheattributes=org.apache.stratum.jcs.engine.Com
po
> siteCacheAttributes
>   +jcs.region.hsqlRegion.cacheattributes.MaxObjects=100
> 
>
+jcs.region.hsqlRegion.cacheattributes.MemoryCacheName=org.apache.stratu
m.
> jcs.engine.memory.lru.LRUMemoryCache
>   +
>   +jcs.region.jispRegion=jispDiskCache
> 
>
+jcs.region.jispRegion.cacheattributes=org.apache.stratum.jcs.engine.Com
po
> siteCacheAttributes
>   +jcs.region.jispRegion.cacheattributes.MaxObjects=100
> 
>
+jcs.region.jispRegion.cacheattributes.MemoryCacheName=org.apache.stratu
m.
> jcs.engine.memory.lru.LRUMemoryCache
>   +
>   +##### AUXILIARY CACHES
>   +
>   +# Indexed Disk Cache
> 
>
+jcs.auxiliary.indexedDiskCache=org.apache.stratum.jcs.auxiliary.disk.in
de
> xed.IndexedDiskCacheFactory
> 
>
+jcs.auxiliary.indexedDiskCache.attributes=org.apache.stratum.jcs.auxili
ar
> y.disk.indexed.IndexedDiskCacheAttributes
>
+jcs.auxiliary.indexedDiskCache.attributes.DiskPath=bin/test/indexed-
> disk-cache
>   +
>   +# HSQL Disk Cache
> 
>
+jcs.auxiliary.hsqlDiskCache=org.apache.stratum.jcs.auxiliary.disk.hsql.
HS
> QLCacheFactory
> 
>
+jcs.auxiliary.hsqlDiskCache.attributes=org.apache.stratum.jcs.auxiliary
.d
> isk.hsql.HSQLCacheAttributes
>   +jcs.auxiliary.hsqlDiskCache.attributes.DiskPath=bin/test/hsql-disk-
> cache
>   +
>   +# JISP Disk Cache
> 
>
+jcs.auxiliary.jispDiskCache=org.apache.stratum.jcs.auxiliary.disk.jisp.
JI
> SPCacheFactory
> 
>
+jcs.auxiliary.jispDiskCache.attributes=org.apache.stratum.jcs.auxiliary
.d
> isk.jisp.JISPCacheAttributes
>   +jcs.auxiliary.jispDiskCache.attributes.DiskPath=bin/test/jisp-disk-
> cache
>   +jcs.auxiliary.jispDiskCache.attributes.ClearOnStart=false
>   \ No newline at end of file
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:turbine-dev-
> [EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:turbine-dev-
> [EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to