You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jcs-dev@jakarta.apache.org by as...@apache.org on 2008/08/29 21:45:18 UTC
svn commit: r690378 - in /jakarta/jcs/trunk/src:
java/org/apache/jcs/auxiliary/ java/org/apache/jcs/auxiliary/disk/
java/org/apache/jcs/auxiliary/disk/block/
java/org/apache/jcs/auxiliary/disk/indexed/
java/org/apache/jcs/auxiliary/disk/jdbc/ java/org/...
Author: asmuts
Date: Fri Aug 29 12:45:17 2008
New Revision: 690378
URL: http://svn.apache.org/viewvc?rev=690378&view=rev
Log:
Refactored event logging for the disk caches.
Modified:
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/AbstractAuxiliaryCacheEventLogging.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/AbstractDiskCache.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCache.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCache.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManagerAbstractTemplate.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCache.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCache.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheAttributes.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheNoWaitFacade.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheRestore.java
jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/HugeQuantityIndDiskCacheLoadTest.java
jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexDiskCacheUnitTest.java
jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheKeyStoreUnitTest.java
jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheOptimizationUnitTest.java
jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheUnitTest.java
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/AbstractAuxiliaryCacheEventLogging.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/AbstractAuxiliaryCacheEventLogging.java?rev=690378&r1=690377&r2=690378&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/AbstractAuxiliaryCacheEventLogging.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/AbstractAuxiliaryCacheEventLogging.java Fri Aug 29 12:45:17 2008
@@ -241,7 +241,7 @@
* <p>
* @throws IOException
*/
- public final void dispose()
+ public void dispose()
throws IOException
{
disposeWithEventLogging();
@@ -253,7 +253,7 @@
* <p>
* @throws IOException
*/
- protected void disposeWithEventLogging()
+ protected final void disposeWithEventLogging()
throws IOException
{
ICacheEvent cacheEvent = createICacheEvent( getCacheName(), "none", ICacheEventLogger.DISPOSE_EVENT );
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/AbstractDiskCache.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/AbstractDiskCache.java?rev=690378&r1=690377&r2=690378&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/AbstractDiskCache.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/AbstractDiskCache.java Fri Aug 29 12:45:17 2008
@@ -31,7 +31,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.jcs.auxiliary.AbstractAuxiliaryCache;
+import org.apache.jcs.auxiliary.AbstractAuxiliaryCacheEventLogging;
import org.apache.jcs.auxiliary.AuxiliaryCache;
import org.apache.jcs.auxiliary.disk.behavior.IDiskCacheAttributes;
import org.apache.jcs.engine.CacheConstants;
@@ -61,7 +61,7 @@
* Should it dispose itself?
*/
public abstract class AbstractDiskCache
- extends AbstractAuxiliaryCache
+ extends AbstractAuxiliaryCacheEventLogging
implements AuxiliaryCache, Serializable
{
/** Don't change. */
@@ -307,7 +307,7 @@
* @return a map of Serializable key to ICacheElement element, or an empty map if there is no
* data in cache for any of these keys
*/
- public final Map getMultiple( Set keys )
+ public Map processGetMultiple( Set keys )
{
Map elements = new HashMap();
@@ -344,9 +344,10 @@
* <p>
* @param key
* @return whether the item was present to be removed.
+ * @throws IOException
* @see org.apache.jcs.engine.behavior.ICache#remove
*/
- public final boolean remove( Serializable key )
+ public final boolean remove( Serializable key ) throws IOException
{
PurgatoryElement pe = null;
@@ -384,9 +385,10 @@
}
/**
+ * @throws IOException
* @see org.apache.jcs.engine.behavior.ICache#removeAll
*/
- public final void removeAll()
+ public final void removeAll() throws IOException
{
if ( this.dcattr.isAllowRemoveAll() )
{
@@ -416,8 +418,9 @@
* reached.
* <li>Call doDispose on the concrete impl.
* </ol>
+ * @throws IOException
*/
- public final void dispose()
+ public final void dispose() throws IOException
{
Runnable disR = new Runnable()
{
@@ -719,38 +722,91 @@
}
}
- // ---------------------- subclasses should implement the following methods
+ /**
+ * Before the event logging layer, the subclasses implemented the do* methods. Now the do*
+ * methods call the *EventLogging method on the super. The *WithEventLogging methods call the
+ * abstract process* methods. The children implement the process methods.
+ */
/**
* Get a value from the persistent store.
+ * <p>
+ * Before the event logging layer, the subclasses implemented the do* methods. Now the do*
+ * methods call the *EventLogging method on the super. The *WithEventLogging methods call the
+ * abstract process* methods. The children implement the process methods.
+ * <p>
* @param key Key to locate value for.
* @return An object matching key, or null.
+ * @throws IOException
*/
- protected abstract ICacheElement doGet( Serializable key );
+ protected final ICacheElement doGet( Serializable key )
+ throws IOException
+ {
+ return super.getWithEventLogging( key );
+ }
/**
* Add a cache element to the persistent store.
- * @param element
+ * <p>
+ * Before the event logging layer, the subclasses implemented the do* methods. Now the do*
+ * methods call the *EventLogging method on the super. The *WithEventLogging methods call the
+ * abstract process* methods. The children implement the process methods.
+ * <p>
+ * @param cacheElement
+ * @throws IOException
*/
- protected abstract void doUpdate( ICacheElement element );
+ protected final void doUpdate( ICacheElement cacheElement )
+ throws IOException
+ {
+ super.updateWithEventLogging( cacheElement );
+ }
/**
* Remove an object from the persistent store if found.
+ * <p>
+ * Before the event logging layer, the subclasses implemented the do* methods. Now the do*
+ * methods call the *EventLogging method on the super. The *WithEventLogging methods call the
+ * abstract process* methods. The children implement the process methods.
+ * <p>
* @param key Key of object to remove.
* @return whether or no the item was present when removed
+ * @throws IOException
*/
- protected abstract boolean doRemove( Serializable key );
+ protected final boolean doRemove( Serializable key )
+ throws IOException
+ {
+ return super.removeWithEventLogging( key );
+ }
/**
* Remove all objects from the persistent store.
+ * <p>
+ * Before the event logging layer, the subclasses implemented the do* methods. Now the do*
+ * methods call the *EventLogging method on the super. The *WithEventLogging methods call the
+ * abstract process* methods. The children implement the process methods.
+ * <p>
+ * @throws IOException
*/
- protected abstract void doRemoveAll();
+ protected final void doRemoveAll()
+ throws IOException
+ {
+ super.removeAllWithEventLogging();
+ }
/**
* Dispose of the persistent store. Note that disposal of purgatory and setting alive to false
* does NOT need to be done by this method.
+ * <p>
+ * Before the event logging layer, the subclasses implemented the do* methods. Now the do*
+ * methods call the *EventLogging method on the super. The *WithEventLogging methods call the
+ * abstract process* methods. The children implement the process methods.
+ * <p>
+ * @throws IOException
*/
- protected abstract void doDispose();
+ protected final void doDispose() throws IOException
+ {
+ super.disposeWithEventLogging();
+ }
/**
* Gets the extra info for the event log.
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCache.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCache.java?rev=690378&r1=690377&r2=690378&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCache.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/block/BlockDiskCache.java Fri Aug 29 12:45:17 2008
@@ -145,8 +145,6 @@
log.error( logCacheName + "Failure initializing for fileName: " + fileName + " and root directory: "
+ rootDirName, e );
}
- ShutdownHook shutdownHook = new ShutdownHook();
- Runtime.getRuntime().addShutdownHook( shutdownHook );
}
/**
@@ -242,9 +240,11 @@
* <li>Release the lock.</li>
* </ol>
* (non-Javadoc)
+ * @param key
+ * @return ICacheElement
* @see org.apache.jcs.auxiliary.disk.AbstractDiskCache#doGet(java.io.Serializable)
*/
- protected ICacheElement doGet( Serializable key )
+ protected ICacheElement processGet( Serializable key )
{
if ( !alive )
{
@@ -301,9 +301,10 @@
* <li>Release the write lock.</li>
* </ol>
* (non-Javadoc)
+ * @param element
* @see org.apache.jcs.auxiliary.disk.AbstractDiskCache#doUpdate(org.apache.jcs.engine.behavior.ICacheElement)
*/
- protected void doUpdate( ICacheElement element )
+ protected void processUpdate( ICacheElement element )
{
if ( !alive )
{
@@ -357,9 +358,11 @@
* implementation always result in a disk orphan.
* <p>
* (non-Javadoc)
+ * @param key
+ * @return true if removed anything
* @see org.apache.jcs.auxiliary.disk.AbstractDiskCache#doRemove(java.io.Serializable)
*/
- protected boolean doRemove( Serializable key )
+ protected boolean processRemove( Serializable key )
{
if ( !alive )
{
@@ -457,7 +460,7 @@
* (non-Javadoc)
* @see org.apache.jcs.auxiliary.disk.AbstractDiskCache#doRemoveAll()
*/
- protected void doRemoveAll()
+ protected void processRemoveAll()
{
try
{
@@ -476,7 +479,7 @@
* <p>
* TODO make dispose window configurable.
*/
- public void doDispose()
+ public void processDispose()
{
Runnable disR = new Runnable()
{
@@ -622,24 +625,6 @@
}
/**
- * Called on shutdown. This gives use a chance to store the keys even if the cache manager's
- * shutdown method was not called.
- */
- class ShutdownHook
- extends Thread
- {
- /** Disposes of the cache. This will result force the keys to be persisted. */
- public void run()
- {
- if ( alive )
- {
- log.warn( logCacheName + "Disk cache not shutdown properly, shutting down now." );
- doDispose();
- }
- }
- }
-
- /**
* Gets basic stats for the disk cache.
* <p>
* @return String
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java?rev=690378&r1=690377&r2=690378&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java Fri Aug 29 12:45:17 2008
@@ -424,26 +424,7 @@
* <p>
* @param ce The ICacheElement to put to disk.
*/
- public void doUpdate( ICacheElement ce )
- {
- ICacheEvent cacheEvent = createICacheEvent( ce, ICacheEventLogger.UPDATE_EVENT );
- try
- {
- processUpdate( ce );
- }
- finally
- {
- logICacheEvent( cacheEvent );
- }
- }
-
- /**
- * Update the disk cache. Called from the Queue. Makes sure the Item has not been retireved from
- * purgatory while in queue for disk. Remove items from purgatory when they go to disk.
- * <p>
- * @param ce The ICacheElement to put to disk.
- */
- private void processUpdate( ICacheElement ce )
+ protected void processUpdate( ICacheElement ce )
{
if ( !alive )
{
@@ -546,32 +527,13 @@
}
/**
+ * Gets the key, then goes to disk to get the object.
+ * <p>
* @param key
* @return ICacheElement or null
* @see AbstractDiskCache#doGet
*/
- protected ICacheElement doGet( Serializable key )
- {
- ICacheElement object = null;
- ICacheEvent cacheEvent = createICacheEvent( cacheName, key, ICacheEventLogger.GET_EVENT );
- try
- {
- object = processGet( key, object );
- }
- finally
- {
- logICacheEvent( cacheEvent );
- }
- return object;
- }
-
- /**
- * @param key
- * @param object
- * @return ICacheElement or null
- * @see AbstractDiskCache#doGet
- */
- private ICacheElement processGet( Serializable key, ICacheElement object )
+ protected ICacheElement processGet( Serializable key )
{
if ( !alive )
{
@@ -584,6 +546,7 @@
log.debug( logCacheName + "Trying to get from disk: " + key );
}
+ ICacheElement object = null;
try
{
storageLock.readLock().acquire();
@@ -695,27 +658,7 @@
* @return true if at least one item was removed.
* @param key
*/
- public boolean doRemove( Serializable key )
- {
- ICacheEvent cacheEvent = createICacheEvent( cacheName, key, ICacheEventLogger.REMOVE_EVENT );
- try
- {
- return processRemove( key );
- }
- finally
- {
- logICacheEvent( cacheEvent );
- }
- }
-
- /**
- * Returns true if the removal was successful; or false if there is nothing to remove. Current
- * implementation always result in a disk orphan.
- * <p>
- * @return true if at least one item was removed.
- * @param key
- */
- private boolean processRemove( Serializable key )
+ protected boolean processRemove( Serializable key )
{
if ( !alive )
{
@@ -882,7 +825,7 @@
/**
* Remove all the items from the disk cache by reseting everything.
*/
- public void doRemoveAll()
+ public void processRemoveAll()
{
ICacheEvent cacheEvent = createICacheEvent( cacheName, "all", ICacheEventLogger.REMOVEALL_EVENT );
try
@@ -994,7 +937,7 @@
* <p>
* TODO make dispose window configurable.
*/
- public void doDispose()
+ public void processDispose()
{
ICacheEvent cacheEvent = createICacheEvent( cacheName, "none", ICacheEventLogger.DISPOSE_EVENT );
try
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCache.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCache.java?rev=690378&r1=690377&r2=690378&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCache.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCache.java Fri Aug 29 12:45:17 2008
@@ -173,27 +173,7 @@
* <p>
* @param ce
*/
- public void doUpdate( ICacheElement ce )
- {
- ICacheEvent cacheEvent = createICacheEvent( ce, ICacheEventLogger.UPDATE_EVENT );
- try
- {
- processUpdate( ce );
- }
- finally
- {
- logICacheEvent( cacheEvent );
- }
- }
-
- /**
- * Inserts or updates. By default it will try to insert. If the item exists we will get an
- * error. It will then update. This behavior is configurable. The cache can be configured to
- * check before inserting.
- * <p>
- * @param ce
- */
- private void processUpdate( ICacheElement ce )
+ protected void processUpdate( ICacheElement ce )
{
incrementUpdateCount();
@@ -496,32 +476,11 @@
/**
* Queries the database for the value. If it gets a result, the value is deserialized.
* <p>
- * @see org.apache.jcs.auxiliary.disk.AbstractDiskCache#doGet(java.io.Serializable)
- */
- public ICacheElement doGet( Serializable key )
- {
- ICacheElement obj = null;
- ICacheEvent cacheEvent = createICacheEvent( cacheName, key, ICacheEventLogger.GET_EVENT );
- try
- {
- obj = processGet( key, obj );
- }
- finally
- {
- logICacheEvent( cacheEvent );
- }
- return obj;
- }
-
- /**
- * Queries the database for the value. If it gets a result, the value is deserialized.
- * <p>
* @param key
- * @param obj
* @return ICacheElement
* @see org.apache.jcs.auxiliary.disk.AbstractDiskCache#doGet(java.io.Serializable)
*/
- private ICacheElement processGet( Serializable key, ICacheElement obj )
+ protected ICacheElement processGet( Serializable key )
{
incrementGetCount();
@@ -535,6 +494,8 @@
return null;
}
+ ICacheElement obj = null;
+
byte[] data = null;
try
{
@@ -625,27 +586,7 @@
* @param key
* @return boolean
*/
- public boolean doRemove( Serializable key )
- {
- ICacheEvent cacheEvent = createICacheEvent( cacheName, key, ICacheEventLogger.REMOVE_EVENT );
- try
- {
- return processRemove( key );
- }
- finally
- {
- logICacheEvent( cacheEvent );
- }
- }
-
- /**
- * Returns true if the removal was successful; or false if there is nothing to remove. Current
- * implementation always results in a disk orphan.
- * <p>
- * @param key
- * @return boolean
- */
- private boolean processRemove( Serializable key )
+ protected boolean processRemove( Serializable key )
{
// remove single item.
String sql = "delete from " + getJdbcDiskCacheAttributes().getTableName()
@@ -714,24 +655,7 @@
* This should remove all elements. The auxiliary can be configured to forbid this behavior. If
* remove all is not allowed, the method balks.
*/
- public void doRemoveAll()
- {
- ICacheEvent cacheEvent = createICacheEvent( cacheName, "all", ICacheEventLogger.REMOVEALL_EVENT );
- try
- {
- processRemoveAll();
- }
- finally
- {
- logICacheEvent( cacheEvent );
- }
- }
-
- /**
- * This should remove all elements. The auxiliary can be configured to forbid this behavior. If
- * remove all is not allowed, the method balks.
- */
- private void processRemoveAll()
+ protected void processRemoveAll()
{
// it should never get here formt he abstract dis cache.
if ( this.jdbcDiskCacheAttributes.isAllowRemoveAll() )
@@ -868,7 +792,7 @@
}
/** Shuts down the pool */
- public void doDispose()
+ public void processDispose()
{
ICacheEvent cacheEvent = createICacheEvent( cacheName, "none", ICacheEventLogger.DISPOSE_EVENT );
try
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManagerAbstractTemplate.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManagerAbstractTemplate.java?rev=690378&r1=690377&r2=690378&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManagerAbstractTemplate.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManagerAbstractTemplate.java Fri Aug 29 12:45:17 2008
@@ -19,6 +19,7 @@
* under the License.
*/
+import java.io.IOException;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Map;
@@ -162,7 +163,14 @@
JDBCDiskCache raf = (JDBCDiskCache) caches.get( name );
if ( raf != null )
{
- raf.dispose();
+ try
+ {
+ raf.dispose();
+ }
+ catch ( IOException e )
+ {
+ log.error( "Problem disposing of disk.", e );
+ }
}
}
@@ -193,7 +201,14 @@
JDBCDiskCache raf = (JDBCDiskCache) allCaches.nextElement();
if ( raf != null )
{
- raf.dispose();
+ try
+ {
+ raf.dispose();
+ }
+ catch ( IOException e )
+ {
+ log.error( "Problem disposing of disk.", e );
+ }
}
}
}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCache.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCache.java?rev=690378&r1=690377&r2=690378&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCache.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCache.java Fri Aug 29 12:45:17 2008
@@ -73,7 +73,7 @@
* @param key Key to locate value for.
* @return An object matching key, or null.
*/
- public ICacheElement doGet( Serializable key )
+ protected ICacheElement processGet( Serializable key )
{
if ( this.getTableState().getState() == TableState.OPTIMIZATION_RUNNING )
{
@@ -82,7 +82,7 @@
return null;
}
}
- return super.doGet( key );
+ return super.processGet( key );
}
/**
@@ -91,7 +91,7 @@
* <p>
* @param element
*/
- public void doUpdate( ICacheElement element )
+ protected void processUpdate( ICacheElement element )
{
if ( this.getTableState().getState() == TableState.OPTIMIZATION_RUNNING )
{
@@ -100,7 +100,7 @@
return;
}
}
- super.doUpdate( element );
+ super.processUpdate( element );
}
/**
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCache.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCache.java?rev=690378&r1=690377&r2=690378&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCache.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCache.java Fri Aug 29 12:45:17 2008
@@ -54,6 +54,7 @@
/** generalize this, use another interface */
private ILateralCacheAttributes cattr;
+ /** The region name */
final String cacheName;
/** either http, socket.udp, or socket.tcp can set in config */
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheAttributes.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheAttributes.java?rev=690378&r1=690377&r2=690378&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheAttributes.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheAttributes.java Fri Aug 29 12:45:17 2008
@@ -34,7 +34,7 @@
extends AbstractAuxiliaryCacheAttributes
implements Serializable, ILateralCacheAttributes
{
-
+ /** Don't change */
private static final long serialVersionUID = -3408449508837393660L;
private static final boolean DEFAULT_RECEIVE = true;
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheNoWaitFacade.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheNoWaitFacade.java?rev=690378&r1=690377&r2=690378&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheNoWaitFacade.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheNoWaitFacade.java Fri Aug 29 12:45:17 2008
@@ -24,11 +24,11 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.HashSet;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -53,15 +53,19 @@
public class LateralCacheNoWaitFacade
implements AuxiliaryCache
{
+ /** Don't change */
private static final long serialVersionUID = -9047687810358008955L;
+ /** The logger */
private final static Log log = LogFactory.getLog( LateralCacheNoWaitFacade.class );
/** The queuing facade to the client. */
public LateralCacheNoWait[] noWaits;
+ /** The region name */
private String cacheName;
+ /** User configurable attributes. */
private ILateralCacheAttributes lateralCacheAttributes;
/**
@@ -69,12 +73,13 @@
* since the noWaits do this.
*/
private ICacheEventLogger cacheEventLogger;
-
+
/** The serializer. */
- private IElementSerializer elementSerializer;
+ private IElementSerializer elementSerializer;
/**
* Constructs with the given lateral cache, and fires events to any listeners.
+ * <p>
* @param noWaits
* @param cattr
*/
@@ -128,10 +133,9 @@
}
- /*
- * (non-Javadoc)
- *
- * @see org.apache.jcs.engine.behavior.ICache#update(org.apache.jcs.engine.behavior.ICacheElement)
+ /**
+ * @param ce
+ * @throws IOException
*/
public void update( ICacheElement ce )
throws IOException
@@ -215,10 +219,9 @@
return elements;
}
- /*
- * (non-Javadoc)
- *
- * @see org.apache.jcs.auxiliary.AuxiliaryCache#getGroupKeys(java.lang.String)
+ /**
+ * @param group
+ * @return Set
*/
public Set getGroupKeys( String group )
{
@@ -298,7 +301,7 @@
}
/**
- * No lateral invokation.
+ * No lateral invocation.
* @return The size value
*/
public int getSize()
@@ -308,7 +311,8 @@
}
/**
- * Gets the cacheType attribute of the LateralCacheNoWaitFacade object
+ * Gets the cacheType attribute of the LateralCacheNoWaitFacade object.
+ * <p>
* @return The cacheType value
*/
public int getCacheType()
@@ -317,7 +321,8 @@
}
/**
- * Gets the cacheName attribute of the LateralCacheNoWaitFacade object
+ * Gets the cacheName attribute of the LateralCacheNoWaitFacade object.
+ * <p>
* @return The cacheName value
*/
public String getCacheName()
@@ -383,10 +388,8 @@
return getStatistics().toString();
}
- /*
- * (non-Javadoc)
- *
- * @see org.apache.jcs.auxiliary.AuxiliaryCache#getStatistics()
+ /**
+ * @return IStats
*/
public IStats getStatistics()
{
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheRestore.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheRestore.java?rev=690378&r1=690377&r2=690378&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheRestore.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/lateral/LateralCacheRestore.java Fri Aug 29 12:45:17 2008
@@ -27,24 +27,26 @@
import org.apache.jcs.engine.behavior.ICacheRestore;
/**
- * Used to repair the lateral caches managed by the associated instance of
- * LateralCacheManager.
- *
+ * Used to repair the lateral caches managed by the associated instance of LateralCacheManager.
*/
public class LateralCacheRestore
implements ICacheRestore
{
+ /** The logger */
private final static Log log = LogFactory.getLog( LateralCacheRestore.class );
+ /** The lateral manager. */
private final ILateralCacheManager lcm;
+ /** fixable indicator */
private boolean canFix = true;
+ /** handle */
private Object lateralObj;
/**
* Constructs with the given instance of LateralCacheManager.
- *
+ * <p>
* @param lcm
*/
public LateralCacheRestore( ILateralCacheManager lcm )
@@ -53,9 +55,9 @@
}
/**
- * Returns true iff the connection to the lateral host for the corresponding
- * cache manager can be successfully re-established.
- *
+ * Returns true iff the connection to the lateral host for the corresponding cache manager can
+ * be successfully re-established.
+ * <p>
* @return whether or not the cache can be fixed.
*/
public boolean canFix()
Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/HugeQuantityIndDiskCacheLoadTest.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/HugeQuantityIndDiskCacheLoadTest.java?rev=690378&r1=690377&r2=690378&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/HugeQuantityIndDiskCacheLoadTest.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/HugeQuantityIndDiskCacheLoadTest.java Fri Aug 29 12:45:17 2008
@@ -25,31 +25,23 @@
/**
* Put a few hundred thousand entries in the disk cache.
- *
+ * <p>
* @author Aaron Smuts
- *
*/
public class HugeQuantityIndDiskCacheLoadTest
extends TestCase
{
-
- /**
- * Test setup
- */
+ /** Test setup. */
public void setUp()
{
JCS.setConfigFilename( "/TestDiskCacheHuge.ccf" );
}
/**
- * Adds items to cache, gets them, and removes them. The item count is more
- * than the size of the memory cache, so items should spool to disk.
- *
- * @param region
- * Name of the region to access
- *
- * @exception Exception
- * If an error occurs
+ * Adds items to cache, gets them, and removes them. The item count is more than the size of the
+ * memory cache, so items should spool to disk.
+ * <p>
+ * @exception Exception If an error occurs
*/
public void testLargeNumberOfItems()
throws Exception
@@ -61,7 +53,6 @@
try
{
-
System.out.println( "Start: " + measureMemoryUse() );
// Add items to cache
@@ -117,8 +108,8 @@
/**
* Measure memory used by the VM.
- *
- * @return
+ * <p>
+ * @return memory used
* @throws InterruptedException
*/
protected long measureMemoryUse()
Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexDiskCacheUnitTest.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexDiskCacheUnitTest.java?rev=690378&r1=690377&r2=690378&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexDiskCacheUnitTest.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexDiskCacheUnitTest.java Fri Aug 29 12:45:17 2008
@@ -45,8 +45,9 @@
{
/**
* Simply verify that we can put items in the disk cache and retrieve them.
+ * @throws IOException
*/
- public void testSimplePutAndGet()
+ public void testSimplePutAndGet() throws IOException
{
IndexedDiskCacheAttributes cattr = new IndexedDiskCacheAttributes();
cattr.setCacheName( "testSimplePutAndGet" );
@@ -54,7 +55,7 @@
cattr.setDiskPath( "target/test-sandbox/IndexDiskCacheUnitTest" );
IndexedDiskCache disk = new IndexedDiskCache( cattr );
- disk.doRemoveAll();
+ disk.processRemoveAll();
int cnt = 999;
for ( int i = 0; i < cnt; i++ )
@@ -63,12 +64,12 @@
eAttr.setIsSpool( true );
ICacheElement element = new CacheElement( "testSimplePutAndGet", "key:" + i, "data:" + i );
element.setElementAttributes( eAttr );
- disk.doUpdate( element );
+ disk.processUpdate( element );
}
for ( int i = 0; i < cnt; i++ )
{
- ICacheElement element = disk.doGet( "key:" + i );
+ ICacheElement element = disk.processGet( "key:" + i );
assertNotNull( "Should have recevied an element.", element );
assertEquals( "Element is wrong.", "data:" + i, element.getVal() );
}
@@ -93,8 +94,9 @@
/**
* Add some items to the disk cache and then remove them one by one.
+ * @throws IOException
*/
- public void testRemoveItems()
+ public void testRemoveItems() throws IOException
{
IndexedDiskCacheAttributes cattr = new IndexedDiskCacheAttributes();
cattr.setCacheName( "testRemoveItems" );
@@ -102,7 +104,7 @@
cattr.setDiskPath( "target/test-sandbox/IndexDiskCacheUnitTest" );
IndexedDiskCache disk = new IndexedDiskCache( cattr );
- disk.doRemoveAll();
+ disk.processRemoveAll();
int cnt = 25;
for ( int i = 0; i < cnt; i++ )
@@ -111,22 +113,23 @@
eAttr.setIsSpool( true );
ICacheElement element = new CacheElement( "testRemoveItems", "key:" + i, "data:" + i );
element.setElementAttributes( eAttr );
- disk.doUpdate( element );
+ disk.processUpdate( element );
}
// remove each
for ( int i = 0; i < cnt; i++ )
{
disk.remove( "key:" + i );
- ICacheElement element = disk.doGet( "key:" + i );
+ ICacheElement element = disk.processGet( "key:" + i );
assertNull( "Should not have recevied an element.", element );
}
}
/**
* Verify that we don't override the largest item.
+ * @throws IOException
*/
- public void testRecycleBin()
+ public void testRecycleBin() throws IOException
{
IndexedDiskCacheAttributes cattr = new IndexedDiskCacheAttributes();
cattr.setCacheName( "testRemoveItems" );
@@ -146,7 +149,7 @@
{
ICacheElement element = new CacheElement( "testRecycleBin", "key:" + test[i], test[i] );
System.out.println( "About to add " + "key:" + test[i] + " i = " + i );
- disk.doUpdate( element );
+ disk.processUpdate( element );
}
for ( int i = 3; i < 5; i++ )
@@ -161,7 +164,7 @@
{
ICacheElement element = new CacheElement( "testRecycleBin", "key:" + test[i], test[i] );
System.out.println( "About to add " + "key:" + test[i] + " i = " + i );
- disk.doUpdate( element );
+ disk.processUpdate( element );
}
try
@@ -278,7 +281,7 @@
for ( int i = 0; i < elements.length; i++ )
{
- disk.doUpdate( elements[i] );
+ disk.processUpdate( elements[i] );
}
Thread.yield();
@@ -320,7 +323,7 @@
for ( int i = 0; i < elements.length; i++ )
{
- disk.doUpdate( elements[i] );
+ disk.processUpdate( elements[i] );
}
Thread.yield();
@@ -331,7 +334,7 @@
int numberToRemove = elements.length / 2;
for ( int i = 0; i < numberToRemove; i++ )
{
- disk.doRemove( elements[i].getKey() );
+ disk.processRemove( elements[i].getKey() );
}
// verify that the recyle bin has the correct amount.
@@ -368,7 +371,7 @@
// Add some to the disk
for ( int i = 0; i < elements.length; i++ )
{
- disk.doUpdate( elements[i] );
+ disk.processUpdate( elements[i] );
}
Thread.yield();
@@ -379,7 +382,7 @@
int numberToRemove = elements.length / 2;
for ( int i = 0; i < numberToRemove; i++ )
{
- disk.doRemove( elements[i].getKey() );
+ disk.processRemove( elements[i].getKey() );
}
// verify that the recyle bin has the correct amount.
@@ -389,7 +392,7 @@
int numberToAdd = numberToRemove / 2;
for ( int i = 0; i < numberToAdd; i++ )
{
- disk.doUpdate( elements[i] );
+ disk.processUpdate( elements[i] );
}
// verify that we used the correct number of spots
@@ -420,7 +423,7 @@
for ( int i = 0; i < elements.length; i++ )
{
- disk.doUpdate( elements[i] );
+ disk.processUpdate( elements[i] );
}
Thread.yield();
@@ -431,7 +434,7 @@
int numberToRemove = elements.length / 2;
for ( int i = 0; i < numberToRemove; i++ )
{
- disk.doRemove( elements[i].getKey() );
+ disk.processRemove( elements[i].getKey() );
}
long expectedSize = DiskTestObjectUtil.totalSize( elements, numberToRemove );
@@ -445,7 +448,7 @@
int numberToAdd = numberToRemove / 2;
for ( int i = 0; i < numberToAdd; i++ )
{
- disk.doUpdate( elements[i] );
+ disk.processUpdate( elements[i] );
}
long expectedSize2 = DiskTestObjectUtil.totalSize( elements, numberToAdd );
@@ -455,8 +458,9 @@
/**
* Add some items to the disk cache and then remove them one by one.
+ * @throws IOException
*/
- public void testRemove_PartialKey()
+ public void testRemove_PartialKey() throws IOException
{
IndexedDiskCacheAttributes cattr = new IndexedDiskCacheAttributes();
cattr.setCacheName( "testRemove_PartialKey" );
@@ -464,7 +468,7 @@
cattr.setDiskPath( "target/test-sandbox/IndexDiskCacheUnitTest" );
IndexedDiskCache disk = new IndexedDiskCache( cattr );
- disk.doRemoveAll();
+ disk.processRemoveAll();
int cnt = 25;
for ( int i = 0; i < cnt; i++ )
@@ -473,13 +477,13 @@
eAttr.setIsSpool( true );
ICacheElement element = new CacheElement( "testRemove_PartialKey", i + ":key", "data:" + i );
element.setElementAttributes( eAttr );
- disk.doUpdate( element );
+ disk.processUpdate( element );
}
// verif each
for ( int i = 0; i < cnt; i++ )
{
- ICacheElement element = disk.doGet( i + ":key" );
+ ICacheElement element = disk.processGet( i + ":key" );
assertNotNull( "Shoulds have recevied an element.", element );
}
@@ -487,15 +491,16 @@
for ( int i = 0; i < cnt; i++ )
{
disk.remove( i + ":" );
- ICacheElement element = disk.doGet( i + ":key" );
+ ICacheElement element = disk.processGet( i + ":key" );
assertNull( "Should not have recevied an element.", element );
}
}
/**
* Verify that group members are removed if we call remove with a group.
+ * @throws IOException
*/
- public void testRemove_Group()
+ public void testRemove_Group() throws IOException
{
// SETUP
IndexedDiskCacheAttributes cattr = new IndexedDiskCacheAttributes();
@@ -504,7 +509,7 @@
cattr.setDiskPath( "target/test-sandbox/IndexDiskCacheUnitTest" );
IndexedDiskCache disk = new IndexedDiskCache( cattr );
- disk.doRemoveAll();
+ disk.processRemoveAll();
String cacheName = "testRemove_Group_Region";
String groupName = "testRemove_Group";
@@ -520,14 +525,14 @@
eAttr.setIsSpool( true );
element.setElementAttributes( eAttr );
- disk.doUpdate( element );
+ disk.processUpdate( element );
}
// verify each
for ( int i = 0; i < cnt; i++ )
{
GroupAttrName groupAttrName = getGroupAttrName( cacheName, groupName, i + ":key" );
- ICacheElement element = disk.doGet( groupAttrName );
+ ICacheElement element = disk.processGet( groupAttrName );
assertNotNull( "Should have recevied an element.", element );
}
@@ -539,7 +544,7 @@
for ( int i = 0; i < cnt; i++ )
{
GroupAttrName groupAttrName = getGroupAttrName( cacheName, groupName, i + ":key" );
- ICacheElement element = disk.doGet( groupAttrName );
+ ICacheElement element = disk.processGet( groupAttrName );
// VERIFY
assertNull( "Should not have recevied an element.", element );
@@ -576,7 +581,7 @@
cattr.setMaxKeySize( 100 );
cattr.setDiskPath( "target/test-sandbox/IndexDiskCacheUnitTestCEL" );
IndexedDiskCache diskCache = new IndexedDiskCache( cattr );
- diskCache.doRemoveAll();
+ diskCache.processRemoveAll();
MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
diskCache.setCacheEventLogger( cacheEventLogger );
@@ -607,7 +612,7 @@
cattr.setMaxKeySize( 100 );
cattr.setDiskPath( "target/test-sandbox/IndexDiskCacheUnitTestCEL" );
IndexedDiskCache diskCache = new IndexedDiskCache( cattr );
- diskCache.doRemoveAll();
+ diskCache.processRemoveAll();
MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
diskCache.setCacheEventLogger( cacheEventLogger );
@@ -634,7 +639,7 @@
cattr.setMaxKeySize( 100 );
cattr.setDiskPath( "target/test-sandbox/IndexDiskCacheUnitTestCEL" );
IndexedDiskCache diskCache = new IndexedDiskCache( cattr );
- diskCache.doRemoveAll();
+ diskCache.processRemoveAll();
MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
diskCache.setCacheEventLogger( cacheEventLogger );
@@ -646,8 +651,9 @@
diskCache.getMultiple( keys );
// VERIFY
- assertEquals( "Start should have been called.", 1, cacheEventLogger.startICacheEventCalls );
- assertEquals( "End should have been called.", 1, cacheEventLogger.endICacheEventCalls );
+ // 1 for get multiple and 1 for get.
+ assertEquals( "Start should have been called.", 2, cacheEventLogger.startICacheEventCalls );
+ assertEquals( "End should have been called.", 2, cacheEventLogger.endICacheEventCalls );
}
/**
@@ -664,7 +670,7 @@
cattr.setMaxKeySize( 100 );
cattr.setDiskPath( "target/test-sandbox/IndexDiskCacheUnitTestCEL" );
IndexedDiskCache diskCache = new IndexedDiskCache( cattr );
- diskCache.doRemoveAll();
+ diskCache.processRemoveAll();
MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
diskCache.setCacheEventLogger( cacheEventLogger );
@@ -691,7 +697,7 @@
cattr.setMaxKeySize( 100 );
cattr.setDiskPath( "target/test-sandbox/IndexDiskCacheUnitTestCEL" );
IndexedDiskCache diskCache = new IndexedDiskCache( cattr );
- diskCache.doRemoveAll();
+ diskCache.processRemoveAll();
MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();
diskCache.setCacheEventLogger( cacheEventLogger );
Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheKeyStoreUnitTest.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheKeyStoreUnitTest.java?rev=690378&r1=690377&r2=690378&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheKeyStoreUnitTest.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheKeyStoreUnitTest.java Fri Aug 29 12:45:17 2008
@@ -52,7 +52,7 @@
cattr.setDiskPath( "target/test-sandbox/KeyStoreUnitTest" );
IndexedDiskCache disk = new IndexedDiskCache( cattr );
- disk.doRemoveAll();
+ disk.processRemoveAll();
int cnt = 25;
for ( int i = 0; i < cnt; i++ )
@@ -61,12 +61,12 @@
eAttr.setIsSpool( true );
ICacheElement element = new CacheElement( cattr.getCacheName(), "key:" + i, "data:" + i );
element.setElementAttributes( eAttr );
- disk.doUpdate( element );
+ disk.processUpdate( element );
}
for ( int i = 0; i < cnt; i++ )
{
- ICacheElement element = disk.doGet( "key:" + i );
+ ICacheElement element = disk.processGet( "key:" + i );
assertNotNull( "presave, Should have recevied an element.", element );
assertEquals( "presave, element is wrong.", "data:" + i, element.getVal() );
}
@@ -79,7 +79,7 @@
for ( int i = 0; i < cnt; i++ )
{
- ICacheElement element = disk.doGet( "key:" + i );
+ ICacheElement element = disk.processGet( "key:" + i );
assertNotNull( "postsave, Should have recevied an element.", element );
assertEquals( "postsave, element is wrong.", "data:" + i, element.getVal() );
}
@@ -106,7 +106,7 @@
cattr.setDiskPath( "target/test-sandbox/KeyStoreUnitTest" );
IndexedDiskCache disk = new IndexedDiskCache( cattr );
- disk.doRemoveAll();
+ disk.processRemoveAll();
int cnt = 25;
for ( int i = 0; i < cnt; i++ )
@@ -115,7 +115,7 @@
eAttr.setIsSpool( true );
ICacheElement element = new CacheElement( cattr.getCacheName(), "key:" + i, "data:" + i );
element.setElementAttributes( eAttr );
- disk.doUpdate( element );
+ disk.processUpdate( element );
}
long preAddRemoveSize = disk.getDataFileSize();
@@ -124,9 +124,9 @@
eAttr.setIsSpool( true );
ICacheElement elementSetup = new CacheElement( cattr.getCacheName(), "key:" + "A", "data:" + "A" );
elementSetup.setElementAttributes( eAttr );
- disk.doUpdate( elementSetup );
+ disk.processUpdate( elementSetup );
- ICacheElement elementRet = disk.doGet( "key:" + "A" );
+ ICacheElement elementRet = disk.processGet( "key:" + "A" );
assertNotNull( "postsave, Should have recevied an element.", elementRet );
assertEquals( "postsave, element is wrong.", "data:" + "A", elementRet.getVal() );
@@ -146,7 +146,7 @@
for ( int i = 0; i < cnt; i++ )
{
- ICacheElement element = disk.doGet( "key:" + i );
+ ICacheElement element = disk.processGet( "key:" + i );
assertNotNull( "postsave, Should have recevied an element.", element );
assertEquals( "postsave, element is wrong.", "data:" + i, element.getVal() );
}
Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheOptimizationUnitTest.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheOptimizationUnitTest.java?rev=690378&r1=690377&r2=690378&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheOptimizationUnitTest.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheOptimizationUnitTest.java Fri Aug 29 12:45:17 2008
@@ -59,7 +59,7 @@
for ( int i = 0; i < elements.length; i++ )
{
- disk.doUpdate( elements[i] );
+ disk.processUpdate( elements[i] );
}
Thread.sleep( 1000 );
@@ -70,7 +70,7 @@
// DO WORK
for ( int i = 0; i < removeCount; i++ )
{
- disk.doRemove( new Integer( i ) );
+ disk.processRemove( new Integer( i ) );
}
SleepUtil.sleepAtLeast( 1000 );
Modified: jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheUnitTest.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheUnitTest.java?rev=690378&r1=690377&r2=690378&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheUnitTest.java (original)
+++ jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheUnitTest.java Fri Aug 29 12:45:17 2008
@@ -53,7 +53,7 @@
MySQLDiskCache cache = new MySQLDiskCache( attributes, tableState );
- Object result = cache.doGet( "myKey" );
+ Object result = cache.processGet( "myKey" );
assertNull( "The result should be null", result );
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-dev-help@jakarta.apache.org