Author: asmuts
Date: Wed Nov 19 11:45:29 2008
New Revision: 719037
URL: http://svn.apache.org/viewvc?rev=719037&view=rev
Log:
formatting, javadocs, more getMatching, increased version number prior to tag
Modified:
jakarta/jcs/trunk/pom.xml
jakarta/jcs/trunk/project.xml
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/AbstractDiskCache.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/TableState.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/PooledCacheEventQueue.java
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCache.java
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/config/PropertySetter.java
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/timing/ElapsedTimer.java
jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheNoMemoryUnitTest.java
jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheClient.java
jakarta/jcs/trunk/xdocs/changes.xml
Modified: jakarta/jcs/trunk/pom.xml
URL:
http://svn.apache.org/viewvc/jakarta/jcs/trunk/pom.xml?rev=719037&r1=719036&r2=719037&view=diff
==============================================================================
--- jakarta/jcs/trunk/pom.xml (original)
+++ jakarta/jcs/trunk/pom.xml Wed Nov 19 11:45:29 2008
@@ -36,7 +36,7 @@
<groupId>org.apache.jcs</groupId>
<artifactId>jcs</artifactId>
<packaging>pom</packaging>
- <version>1.3.2.4-RC</version>
+ <version>1.3.2.5-RC</version>
<name>Jakarta JCS</name>
<url>http://jakarta.apache.org/jcs/</url>
<inceptionYear>2002</inceptionYear>
Modified: jakarta/jcs/trunk/project.xml
URL:
http://svn.apache.org/viewvc/jakarta/jcs/trunk/project.xml?rev=719037&r1=719036&r2=719037&view=diff
==============================================================================
--- jakarta/jcs/trunk/project.xml (original)
+++ jakarta/jcs/trunk/project.xml Wed Nov 19 11:45:29 2008
@@ -17,7 +17,7 @@
<pomVersion>3</pomVersion>
<name>JCS</name>
<id>jcs</id>
- <currentVersion>1.3.2.4-RC</currentVersion>
+ <currentVersion>1.3.2.5-RC</currentVersion>
<organization>
<name>Apache Software Foundation</name>
<url>http://jakarta.apache.org/</url>
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=719037&r1=719036&r2=719037&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
Wed Nov 19 11:45:29 2008
@@ -651,8 +651,7 @@
{
// TODO consider a timeout.
// we need this so that we can have multiple update
- // threads
- // and still have removeAll request come in that
+ // threads and still have removeAll requests come
in that
// always win
removeAllLock.readLock().acquire();
@@ -671,7 +670,7 @@
}
// I took this out of the purgatory sync block.
- // If the element is still eligable, spool it.
+ // If the element is still eligible, spool it.
if ( pe.isSpoolable() )
{
doUpdate( element );
@@ -689,8 +688,7 @@
synchronized ( purgatory )
{
// After the update has completed, it is safe to
- // remove
- // the element from purgatory.
+ // remove the element from purgatory.
purgatory.remove( element.getKey() );
}
}
@@ -765,8 +763,10 @@
/**
* 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
+ * methods call the *WithEventLogging method on the super. The
*WithEventLogging methods call the
* abstract process* methods. The children implement the process methods.
+ * <p>
+ * ex. doGet calls getWithEventLogging, which calls processGet
*/
/**
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=719037&r1=719036&r2=719037&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
Wed Nov 19 11:45:29 2008
@@ -759,7 +759,7 @@
}
/**
- * Iterates over the keyset. Builds a list of matches. Removes all the
keys in the list . Does
+ * Iterates over the keyset. Builds a list of matches. Removes all the
keys in the list. Does
* not remove via the iterator, since the map impl may not support it.
* <p>
* This operates under a lock obtained in doRemove().
Modified:
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/TableState.java
URL:
http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/TableState.java?rev=719037&r1=719036&r2=719037&view=diff
==============================================================================
---
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/TableState.java
(original)
+++
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/TableState.java
Wed Nov 19 11:45:29 2008
@@ -22,9 +22,9 @@
import java.io.Serializable;
/**
- * This is used by various elemetns of the JDBC disk cache to indicate the
+ * This is used by various elements of the JDBC disk cache to indicate the
* status of a table. The MySQL disk cache, for instance, marks the status as
- * optimizing when a scheduled optimizatio is taking place. This allows the
+ * optimizing when a scheduled optimization is taking place. This allows the
* cache to balk rather than block during long running optimizations.
* <p>
* @author Aaron Smuts
Modified:
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java
URL:
http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java?rev=719037&r1=719036&r2=719037&view=diff
==============================================================================
---
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java
(original)
+++
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java
Wed Nov 19 11:45:29 2008
@@ -618,7 +618,7 @@
{
if ( log.isDebugEnabled() )
{
- log.debug( "NonLocalGet. fromCluster [" + fromCluster + "]
AllowClusterGet ["
+ log.debug( "NonLocalGetMatching. fromCluster [" +
fromCluster + "] AllowClusterGet ["
+
this.remoteCacheServerAttributes.getAllowClusterGet() + "]" );
}
elements = c.getMatching( pattern );
@@ -631,7 +631,7 @@
if ( log.isDebugEnabled() )
{
- log.debug( "LocalGet. fromCluster [" + fromCluster + "]
AllowClusterGet ["
+ log.debug( "LocalGetMatching. fromCluster [" +
fromCluster + "] AllowClusterGet ["
+
this.remoteCacheServerAttributes.getAllowClusterGet() + "]" );
}
elements = c.localGetMatching( pattern );
@@ -754,7 +754,7 @@
// This is the only instance I can think of where we allow a
remote get
// from a remote call. The purpose is to allow remote cache
servers to
// talk to each other. If one goes down, you want it to be able to
get
- // data from those that were up when the failed server comes back o
+ // data from those that were up when the failed server comes back
on
// line.
if ( !fromCluster &&
this.remoteCacheServerAttributes.getAllowClusterGet() )
Modified:
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/PooledCacheEventQueue.java
URL:
http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/PooledCacheEventQueue.java?rev=719037&r1=719036&r2=719037&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/engine/PooledCacheEventQueue.java
(original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/engine/PooledCacheEventQueue.java
Wed Nov 19 11:45:29 2008
@@ -498,7 +498,6 @@
return new StringBuffer( "PutEvent for key: " ).append(
ice.getKey() ).append( " value: " )
.append( ice.getVal() ).toString();
}
-
}
/**
@@ -537,7 +536,6 @@
{
return new StringBuffer( "RemoveEvent for " ).append( key
).toString();
}
-
}
/**
@@ -562,7 +560,6 @@
{
return "RemoveAllEvent";
}
-
}
/**
Modified:
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCache.java
URL:
http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCache.java?rev=719037&r1=719036&r2=719037&view=diff
==============================================================================
---
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCache.java
(original)
+++
jakarta/jcs/trunk/src/java/org/apache/jcs/engine/control/CompositeCache.java
Wed Nov 19 11:45:29 2008
@@ -566,21 +566,7 @@
hitCountAux++;
auxHitCountByIndex[i]++;
- // Spool the item back into memory
- // only spool if the mem cache size is greater
- // than 0, else the item will immediately get
put
- // into purgatory
- if (
memCache.getCacheAttributes().getMaxObjects() > 0 )
- {
- memCache.update( element );
- }
- else
- {
- if ( log.isDebugEnabled() )
- {
- log.debug( "Skipping memory update
since no items are allowed in memory" );
- }
- }
+ copyAuxiliaryRetrievedItemToMemory( element );
}
found = true;
@@ -781,60 +767,7 @@
log.debug( "Got CacheElements: " + elementsFromAuxiliary );
}
- Iterator elementFromAuxiliaryIterator = new HashMap(
elementsFromAuxiliary ).values().iterator();
-
- while ( elementFromAuxiliaryIterator.hasNext() )
- {
- ICacheElement element = (ICacheElement)
elementFromAuxiliaryIterator.next();
-
- // Item found in one of the auxiliary caches.
- if ( element != null )
- {
- if ( isExpired( element ) )
- {
- if ( log.isDebugEnabled() )
- {
- log.debug( cacheName + " - Aux cache[" + i +
"] hit, but element expired." );
- }
-
- missCountExpired++;
-
- // This will tell the remotes to remove the item
- // based on the element's expiration policy. The
elements attributes
- // associated with the item when it created govern
its behavior
- // everywhere.
- remove( element.getKey() );
- elementsFromAuxiliary.remove( element.getKey() );
- }
- else
- {
- if ( log.isDebugEnabled() )
- {
- log.debug( cacheName + " - Aux cache[" + i +
"] hit" );
- }
-
- // Update counters
- hitCountAux++;
- auxHitCountByIndex[i]++;
-
- // Spool the item back into memory
- // only spool if the mem cache size is greater
- // than 0, else the item will immediately get put
- // into purgatory
- if ( memCache.getCacheAttributes().getMaxObjects()
> 0 )
- {
- memCache.update( element );
- }
- else
- {
- if ( log.isDebugEnabled() )
- {
- log.debug( "Skipping memory update since
no items are allowed in memory" );
- }
- }
- }
- }
- }
+ processRetrievedElements( i, elementsFromAuxiliary );
elements.putAll( elementsFromAuxiliary );
@@ -853,7 +786,7 @@
}
/**
- *Build a map of all the matching elements in all of the auxiliaries and
memory.
+ * Build a map of all the matching elements in all of the auxiliaries and
memory.
* <p>
* @param pattern
* @return a map of Serializable key to ICacheElement element, or an empty
map if there is no
@@ -987,66 +920,88 @@
log.debug( "Got CacheElements: " + elementsFromAuxiliary );
}
- Iterator elementFromAuxiliaryIterator = new HashMap(
elementsFromAuxiliary ).values().iterator();
+ processRetrievedElements( i, elementsFromAuxiliary );
- while ( elementFromAuxiliaryIterator.hasNext() )
- {
- ICacheElement element = (ICacheElement)
elementFromAuxiliaryIterator.next();
+ elements.putAll( elementsFromAuxiliary );
+ }
+ }
- // Item found in one of the auxiliary caches.
- if ( element != null )
- {
- if ( isExpired( element ) )
- {
- if ( log.isDebugEnabled() )
- {
- log.debug( cacheName + " - Aux cache[" + i +
"] hit, but element expired." );
- }
+ return elements;
+ }
- missCountExpired++;
+ /**
+ * Remove expired elements retrieved from an auxiliary. Update memory with
good items.
+ * <p>
+ * @param i - the aux index
+ * @param elementsFromAuxiliary
+ * @throws IOException
+ */
+ private void processRetrievedElements( int i, Map elementsFromAuxiliary )
+ throws IOException
+ {
+ Iterator elementFromAuxiliaryIterator = new HashMap(
elementsFromAuxiliary ).values().iterator();
- // This will tell the remotes to remove the item
- // based on the element's expiration policy. The
elements attributes
- // associated with the item when it created govern
its behavior
- // everywhere.
- remove( element.getKey() );
- elementsFromAuxiliary.remove( element.getKey() );
- }
- else
- {
- if ( log.isDebugEnabled() )
- {
- log.debug( cacheName + " - Aux cache[" + i +
"] hit" );
- }
+ while ( elementFromAuxiliaryIterator.hasNext() )
+ {
+ ICacheElement element = (ICacheElement)
elementFromAuxiliaryIterator.next();
- // Update counters
- hitCountAux++;
- auxHitCountByIndex[i]++;
-
- // Spool the item back into memory
- // only spool if the mem cache size is greater
- // than 0, else the item will immediately get put
- // into purgatory
- if ( memCache.getCacheAttributes().getMaxObjects()
> 0 )
- {
- memCache.update( element );
- }
- else
- {
- if ( log.isDebugEnabled() )
- {
- log.debug( "Skipping memory update since
no items are allowed in memory" );
- }
- }
- }
+ // Item found in one of the auxiliary caches.
+ if ( element != null )
+ {
+ if ( isExpired( element ) )
+ {
+ if ( log.isDebugEnabled() )
+ {
+ log.debug( cacheName + " - Aux cache[" + i + "] hit,
but element expired." );
}
+
+ missCountExpired++;
+
+ // This will tell the remotes to remove the item
+ // based on the element's expiration policy. The elements
attributes
+ // associated with the item when it created govern its
behavior
+ // everywhere.
+ remove( element.getKey() );
+ elementsFromAuxiliary.remove( element.getKey() );
}
+ else
+ {
+ if ( log.isDebugEnabled() )
+ {
+ log.debug( cacheName + " - Aux cache[" + i + "] hit" );
+ }
- elements.putAll( elementsFromAuxiliary );
+ // Update counters
+ hitCountAux++;
+ auxHitCountByIndex[i]++;
+
+ copyAuxiliaryRetrievedItemToMemory( element );
+ }
}
}
+ }
- return elements;
+ /**
+ * Copies the item to memory if the memory size is greater than 0. Only
spool if the memory cache
+ * size is greater than 0, else the item will immediately get put into
purgatory.
+ * <p>
+ * @param element
+ * @throws IOException
+ */
+ private void copyAuxiliaryRetrievedItemToMemory( ICacheElement element )
+ throws IOException
+ {
+ if ( memCache.getCacheAttributes().getMaxObjects() > 0 )
+ {
+ memCache.update( element );
+ }
+ else
+ {
+ if ( log.isDebugEnabled() )
+ {
+ log.debug( "Skipping memory update since no items are allowed
in memory" );
+ }
+ }
}
/**
Modified:
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/config/PropertySetter.java
URL:
http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/config/PropertySetter.java?rev=719037&r1=719036&r2=719037&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/config/PropertySetter.java
(original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/config/PropertySetter.java
Wed Nov 19 11:45:29 2008
@@ -286,5 +286,4 @@
}
return null;
}
-
}
Modified:
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/timing/ElapsedTimer.java
URL:
http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/timing/ElapsedTimer.java?rev=719037&r1=719036&r2=719037&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/timing/ElapsedTimer.java
(original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/timing/ElapsedTimer.java
Wed Nov 19 11:45:29 2008
@@ -47,7 +47,7 @@
}
/**
- * Retuns the elapsed time with the display suffix.
+ * Returns the elapsed time with the display suffix.
* <p>
* @return formatted elapsed Time
*/
Modified:
jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheNoMemoryUnitTest.java
URL:
http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheNoMemoryUnitTest.java?rev=719037&r1=719036&r2=719037&view=diff
==============================================================================
---
jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheNoMemoryUnitTest.java
(original)
+++
jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheNoMemoryUnitTest.java
Wed Nov 19 11:45:29 2008
@@ -34,8 +34,6 @@
* Test which exercises the indexed disk cache. This one uses three different
* regions for thre threads. It uses a config file that specifies 0 items in
* memory.
- *
- * @version $Id: TestDiskCacheNoMemory.java 224346 2005-06-04 02:01:59Z asmuts
$
*/
public class IndexedDiskCacheNoMemoryUnitTest
extends TestCase
@@ -47,8 +45,6 @@
private static int items = 2000;
/**
- * Constructor for the TestDiskCache object.
- *
* @param testName
*/
public IndexedDiskCacheNoMemoryUnitTest( String testName )
@@ -58,7 +54,7 @@
/**
* Main method passes this test to the text test runner.
- *
+ * <p>
* @param args
*/
public static void main( String args[] )
@@ -69,7 +65,7 @@
/**
* A unit test suite for JUnit
- *
+ * <p>
* @return The test suite
*/
public static Test suite()
Modified:
jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheClient.java
URL:
http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheClient.java?rev=719037&r1=719036&r2=719037&view=diff
==============================================================================
---
jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheClient.java
(original)
+++
jakarta/jcs/trunk/src/test/org/apache/jcs/auxiliary/remote/MockRemoteCacheClient.java
Wed Nov 19 11:45:29 2008
@@ -36,8 +36,6 @@
import org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheService;
import org.apache.jcs.engine.CacheConstants;
import org.apache.jcs.engine.behavior.ICacheElement;
-import org.apache.jcs.engine.behavior.IElementSerializer;
-import org.apache.jcs.engine.logging.behavior.ICacheEventLogger;
import org.apache.jcs.engine.stats.behavior.IStats;
/**
Modified: jakarta/jcs/trunk/xdocs/changes.xml
URL:
http://svn.apache.org/viewvc/jakarta/jcs/trunk/xdocs/changes.xml?rev=719037&r1=719036&r2=719037&view=diff
==============================================================================
--- jakarta/jcs/trunk/xdocs/changes.xml (original)
+++ jakarta/jcs/trunk/xdocs/changes.xml Wed Nov 19 11:45:29 2008
@@ -21,6 +21,10 @@
<body>
<release version="1.4-dev" date="in SVN">
</release>
+ <release version="1.3.2.5" date="2008-11-20"
description="tempbuild">
+ <action dev="asmuts" type="update">Added a getMatching(
String pattern ) API.
+ </action>
+ </release>
<release version="1.3.2.4" date="2008-?"
description="tempbuild">
<action dev="asmuts" type="update">Added the ability to
inject a
custom event queue. You simply specify the
classname as the type.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]