[jboss-cvs] JBossCache/src/org/jboss/cache/eviction ...
Manik Surtani
msurtani at jboss.com
Thu Oct 12 19:03:58 EDT 2006
User: msurtani
Date: 06/10/12 19:03:58
Modified: src/org/jboss/cache/eviction LFUAlgorithm.java
RegionManager.java Region.java
EvictionAlgorithm.java BaseEvictionAlgorithm.java
RegionNameConflictException.java
EvictionTimerTask.java
Log:
a LOT of changes around Regions, in an attempt to unify eviction and marshalling regions
Revision Changes Path
1.5 +2 -2 JBossCache/src/org/jboss/cache/eviction/LFUAlgorithm.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: LFUAlgorithm.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/eviction/LFUAlgorithm.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- LFUAlgorithm.java 7 May 2006 03:34:39 -0000 1.4
+++ LFUAlgorithm.java 12 Oct 2006 23:03:58 -0000 1.5
@@ -29,7 +29,7 @@
* a node is visited, the less likely it will be evicted.
*
* @author Daniel Huang - dhuang at jboss.org 10/2005
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
public class LFUAlgorithm extends BaseSortedEvictionAlgorithm implements EvictionAlgorithm
{
@@ -65,7 +65,7 @@
/**
* Will create a LFUQueue to be used as the underlying eviction queue.
*
- * @param region Region to create the eviction queue for.
+ * @param region MarshRegion to create the eviction queue for.
* @return The created LFUQueue.
* @throws EvictionException
*/
1.23 +19 -19 JBossCache/src/org/jboss/cache/eviction/RegionManager.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: RegionManager.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/eviction/RegionManager.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- RegionManager.java 12 Oct 2006 03:36:46 -0000 1.22
+++ RegionManager.java 12 Oct 2006 23:03:58 -0000 1.23
@@ -34,7 +34,7 @@
*
* @author Ben Wang 02-2004
* @author Daniel Huang (dhuang at jboss.org)
- * @version $Id: RegionManager.java,v 1.22 2006/10/12 03:36:46 bstansberry Exp $
+ * @version $Id: RegionManager.java,v 1.23 2006/10/12 23:03:58 msurtani Exp $
*/
public class RegionManager
{
@@ -86,7 +86,7 @@
{
if (policy_ == null)
{
- throw new RuntimeException("Deprecated API not properly setup for use. The RegionManager must be constructed with a single Policy");
+ throw new RuntimeException("Deprecated API not properly setup for use. The MarshRegionManager must be constructed with a single Policy");
}
EvictionConfiguration configuration;
@@ -256,7 +256,7 @@
}
/**
- * Returns the Region belonging to a String FQN.
+ * Returns the MarshRegion belonging to a String FQN.
*/
public Region getRegion(String myFqn)
{
@@ -264,7 +264,7 @@
}
/**
- * Returns the Region corresponding to this Fqn.
+ * Returns the MarshRegion corresponding to this Fqn.
*/
public Region getRegion(Fqn fqn)
{
@@ -290,7 +290,7 @@
if (region == null)
{
throw new RuntimeException(
- "RegionManager.getRegion(): Default region (" + DEFAULT_REGION + ") is not configured!" +
+ "MarshRegionManager.getRegion(): Default region (" + DEFAULT_REGION + ") is not configured!" +
" You will need to define it in your EvictionPolicyConfig.");
}
return region;
@@ -330,7 +330,7 @@
Fqn child = fqn.getFqnChild(i);
if (regionMap_.containsKey(child))
{
- throw new RegionNameConflictException("RegionManager.checkConflict(): new region fqn "
+ throw new RegionNameConflictException("MarshRegionManager.checkConflict(): new region fqn "
+ fqn + " is in conflict with existing region fqn " + child);
}
}
@@ -395,7 +395,7 @@
// use the eviction policy class specified per region or use the one specified for the entire cache.
// this maintains JBCache configuration backwards compatibility. The old style configuration
// where there is only one Policy for all Regions will still work. We can also now support
- // a different policy per Region (new style configuration - version 1.3+).
+ // a different policy per MarshRegion (new style configuration - version 1.3+).
String evictionClass = regionConfig.getAttribute(EvictionConfiguration.REGION_POLICY_CLASS);
if (evictionClass == null || evictionClass.length() == 0)
{
1.13 +5 -5 JBossCache/src/org/jboss/cache/eviction/Region.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Region.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/eviction/Region.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- Region.java 12 Oct 2006 03:36:46 -0000 1.12
+++ Region.java 12 Oct 2006 23:03:58 -0000 1.13
@@ -20,11 +20,11 @@
*
* @author Ben Wang 2-2004
* @author Daniel Huang (dhuang at jboss.org)
- * @version $Revision: 1.12 $
+ * @version $Revision: 1.13 $
*/
public class Region
{
- // Region Fqn
+ // MarshRegion Fqn
private Fqn fqn_;
// policy used by this region.
private EvictionPolicy policy_;
@@ -48,7 +48,7 @@
{
if (CAPACITY_WARN_THRESHOLD <= 0)
{
- throw new RuntimeException("Region.Region(): CAPACITY_WARN_THRESHOLD constant used in eviction is smaller than 1.");
+ throw new RuntimeException("MarshRegion.MarshRegion(): CAPACITY_WARN_THRESHOLD constant used in eviction is smaller than 1.");
}
createQueue();
}
1.3 +3 -3 JBossCache/src/org/jboss/cache/eviction/EvictionAlgorithm.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: EvictionAlgorithm.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/eviction/EvictionAlgorithm.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- EvictionAlgorithm.java 5 Dec 2005 03:17:13 -0000 1.2
+++ EvictionAlgorithm.java 12 Oct 2006 23:03:58 -0000 1.3
@@ -8,7 +8,7 @@
*
* @author Ben Wang 2-2004
* @author Daniel Huang - dhuang at jboss.org - 10/2005
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public interface EvictionAlgorithm
{
@@ -16,14 +16,14 @@
* Entry point for evictin algorithm. This is an api called by the EvictionTimerTask
* to process the node events in waiting and actual pruning, if necessary.
*
- * @param region Region that this algorithm will operate on.
+ * @param region MarshRegion that this algorithm will operate on.
*/
void process(Region region) throws EvictionException;
/**
* Reset the whole eviction queue. Queue may needs to be reset due to corrupted state, for example.
*
- * @param region Region that this algorithm will operate on.
+ * @param region MarshRegion that this algorithm will operate on.
*/
void resetEvictionQueue(Region region);
1.13 +6 -6 JBossCache/src/org/jboss/cache/eviction/BaseEvictionAlgorithm.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: BaseEvictionAlgorithm.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/eviction/BaseEvictionAlgorithm.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- BaseEvictionAlgorithm.java 12 Oct 2006 03:36:46 -0000 1.12
+++ BaseEvictionAlgorithm.java 12 Oct 2006 23:03:58 -0000 1.13
@@ -19,7 +19,7 @@
* abstract methods and a policy.
*
* @author Daniel Huang - dhuang at jboss.org 10/2005
- * @version $Revision: 1.12 $
+ * @version $Revision: 1.13 $
*/
public abstract class BaseEvictionAlgorithm implements EvictionAlgorithm
{
@@ -43,7 +43,7 @@
/**
* This method will create an EvictionQueue implementation and prepare it for use.
*
- * @param region Region to setup an eviction queue for.
+ * @param region MarshRegion to setup an eviction queue for.
* @return The created EvictionQueue to be used as the eviction queue for this algorithm.
* @throws EvictionException
* @see EvictionQueue
1.3 +8 -4 JBossCache/src/org/jboss/cache/eviction/RegionNameConflictException.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: RegionNameConflictException.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/eviction/RegionNameConflictException.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- RegionNameConflictException.java 13 Feb 2006 16:22:07 -0000 1.2
+++ RegionNameConflictException.java 12 Oct 2006 23:03:58 -0000 1.3
@@ -1,20 +1,24 @@
package org.jboss.cache.eviction;
+
/**
- * Region name conflicts with pre-existing regions.
+ * MarshRegion name conflicts with pre-existing regions.
*
* @author Ben Wang 2-2004
*/
public class RegionNameConflictException extends Exception
{
- public RegionNameConflictException() {
+ public RegionNameConflictException()
+ {
super();
}
- public RegionNameConflictException(String msg) {
+ public RegionNameConflictException(String msg)
+ {
super(msg);
}
- public RegionNameConflictException(String msg, Throwable cause) {
+ public RegionNameConflictException(String msg, Throwable cause)
+ {
super(msg, cause);
}
}
1.5 +6 -6 JBossCache/src/org/jboss/cache/eviction/EvictionTimerTask.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: EvictionTimerTask.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/eviction/EvictionTimerTask.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- EvictionTimerTask.java 15 Mar 2006 16:02:38 -0000 1.4
+++ EvictionTimerTask.java 12 Oct 2006 23:03:58 -0000 1.5
@@ -21,7 +21,7 @@
*
* @author Ben Wang 2-2004
* @author Daniel Huang (dhuang at jboss.org)
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
public class EvictionTimerTask extends TimerTask
{
@@ -37,9 +37,9 @@
}
/**
- * Add a Region to process by the Eviction Thread.
+ * Add a MarshRegion to process by the Eviction Thread.
*
- * @param region Region to process.
+ * @param region MarshRegion to process.
*/
public void addRegionToProcess(Region region)
{
@@ -47,7 +47,7 @@
}
/**
- * Remove a Region to process from the Eviction thread.
+ * Remove a MarshRegion to process from the Eviction thread.
*
* @param region
*/
@@ -59,7 +59,7 @@
/**
* Run the eviction thread.
* <p/>
- * This thread will synchronize the set of regions and iterate through every Region registered w/ the
+ * This thread will synchronize the set of regions and iterate through every MarshRegion registered w/ the
* Eviction thread. It also synchronizes on each individual region as it is being processed.
*/
public void run()
More information about the jboss-cvs-commits
mailing list