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/27 21:12:07 UTC
svn commit: r689570 - in /jakarta/jcs/trunk/src/java/org/apache/jcs:
auxiliary/ auxiliary/disk/indexed/ auxiliary/disk/jdbc/
auxiliary/disk/jdbc/hsql/ auxiliary/disk/jdbc/mysql/ auxiliary/remote/
auxiliary/remote/server/ utils/struct/
Author: asmuts
Date: Wed Aug 27 12:12:06 2008
New Revision: 689570
URL: http://svn.apache.org/viewvc?rev=689570&view=rev
Log:
fixing javadocs
Modified:
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/AbstractAuxiliaryCache.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/AbstractAuxiliaryCacheEventLogging.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCache.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheAttributes.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheManager.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskElementDescriptor.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/JDBCDiskCacheAttributes.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheFactory.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManager.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCachePoolAccess.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/ShrinkerThread.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheFactory.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheManager.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCache.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFactory.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFailoverRunner.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheListener.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheManager.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheRestore.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteUtils.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/ZombieRemoteCacheService.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServer.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerAttributes.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java
jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheStartupServlet.java
jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/BoundedQueue.java
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/AbstractAuxiliaryCache.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/AbstractAuxiliaryCache.java?rev=689570&r1=689569&r2=689570&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/AbstractAuxiliaryCache.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/AbstractAuxiliaryCache.java Wed Aug 27 12:12:06 2008
@@ -29,7 +29,8 @@
* Logs an event if an event logger is configured.
* <p>
* @param item
- * @param requesterId
+ * @param eventName
+ * @return ICacheEvent
*/
protected ICacheEvent createICacheEvent( ICacheElement item, String eventName )
{
@@ -50,9 +51,10 @@
/**
* Logs an event if an event logger is configured.
* <p>
- * @param cacheName
+ * @param regionName
* @param key
- * @param requesterId
+ * @param eventName
+ * @return ICacheEvent
*/
protected ICacheEvent createICacheEvent( String regionName, Serializable key, String eventName )
{
@@ -69,8 +71,7 @@
/**
* Logs an event if an event logger is configured.
* <p>
- * @param item
- * @param requesterId
+ * @param cacheEvent
*/
protected void logICacheEvent( ICacheEvent cacheEvent )
{
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=689570&r1=689569&r2=689570&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 Wed Aug 27 12:12:06 2008
@@ -149,6 +149,7 @@
* @param keys
* @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
+ * @throws IOException
*/
protected abstract Map processGetMultiple( Set keys )
throws IOException;
@@ -229,6 +230,8 @@
/**
* Specific implementation of removeAll.
+ * <p>
+ * @throws IOException
*/
protected abstract void processRemoveAll()
throws IOException;
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=689570&r1=689569&r2=689570&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 Aug 27 12:12:06 2008
@@ -68,36 +68,49 @@
/** The logger */
private static final Log log = LogFactory.getLog( IndexedDiskCache.class );
+ /** Cache name used in log messages */
private final String logCacheName;
+ /** The name of the file where the data is stored */
private String fileName;
+ /** The IndexedDisk manages reads and writes to the data file. */
private IndexedDisk dataFile;
+ /** The IndexedDisk manages reads and writes to the key file. */
private IndexedDisk keyFile;
+ /** Map containing the keys and disk offsets. */
private Map keyHash;
+ /** The maximum number of keys that we will keep in memory. */
private int maxKeySize;
+ /** A handle on the data file. */
private File rafDir;
+ /** Should we keep adding to the recycle bin. False during optimization. */
boolean doRecycle = true;
+ /** Should we optimize real time */
boolean isRealTimeOptimizationEnabled = true;
+ /** Should we optimize on shutdown. */
boolean isShutdownOptimizationEnabled = true;
/** are we currently optimizing the files */
boolean isOptimizing = false;
+ /** The numer of times the file has been optimized. */
private int timesOptimized = 0;
+ /** The thread optimizing the file. */
private volatile Thread currentOptimizationThread;
/** used for counting the number of requests */
private int removeCount = 0;
+ /** Should we queue puts. True when optimizing. We write the queue post optimization. */
private boolean queueInput = false;
/** list where puts made during optimization are made */
@@ -106,15 +119,19 @@
/** RECYLCE BIN -- array of empty spots */
private SortedPreferentialArray recycle;
+ /** User configurable parameters */
private IndexedDiskCacheAttributes cattr;
+ /** How many slots have we recycled. */
private int recycleCnt = 0;
+ /** How many items were there on startup. */
private int startupSize = 0;
/** the number of bytes free on disk. */
private long bytesFree = 0;
+ /** simple stat */
private int hitCount = 0;
/**
@@ -552,6 +569,7 @@
/**
* @param key
+ * @param object
* @return ICacheElement or null
* @see AbstractDiskCache#doGet
*/
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheAttributes.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheAttributes.java?rev=689570&r1=689569&r2=689570&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheAttributes.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheAttributes.java Wed Aug 27 12:12:06 2008
@@ -28,13 +28,16 @@
public class IndexedDiskCacheAttributes
extends AbstractDiskCacheAttributes
{
+ /** Don't change. */
private static final long serialVersionUID = -2190863599358782950L;
+ /** default value */
private static final int DEFAULT_maxKeySize = 5000;
/** -1 means no limit. */
private int maxKeySize = DEFAULT_maxKeySize;
+ /** default value */
private static final int DEFAULT_maxRecycleBinSize = 5000;
/**
@@ -43,12 +46,13 @@
*/
private int maxRecycleBinSize = DEFAULT_maxRecycleBinSize;
- // default to -1, i.e., don't optimize until shutdown
+ /** default to -1, i.e., don't optimize until shutdown */
private int optimizeAtRemoveCount = -1;
/** Should we optimize on shutdown. */
public static final boolean DEFAULT_OPTIMIZE_ON_SHUTDOWN = true;
+ /** Should we optimize on shutdown. */
private boolean optimizeOnShutdown = DEFAULT_OPTIMIZE_ON_SHUTDOWN;
/**
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheManager.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheManager.java?rev=689570&r1=689569&r2=689570&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheManager.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskCacheManager.java Wed Aug 27 12:12:06 2008
@@ -35,16 +35,22 @@
public class IndexedDiskCacheManager
implements AuxiliaryCacheManager
{
+ /** Don't change */
private static final long serialVersionUID = -4153287154512274626L;
+ /** The logger */
private final static Log log = LogFactory.getLog( IndexedDiskCacheManager.class );
+ /** How many checkout have we received. Decremented on release. This isn't very useful. */
private static int clients;
+ /** Singleton instance. */
private static IndexedDiskCacheManager instance;
+ /** Each region has an entry here. */
private Hashtable caches = new Hashtable();
+ /** User configurable atributes */
private IndexedDiskCacheAttributes defaultCacheAttributes;
/**
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskElementDescriptor.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskElementDescriptor.java?rev=689570&r1=689569&r2=689570&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskElementDescriptor.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/indexed/IndexedDiskElementDescriptor.java Wed Aug 27 12:12:06 2008
@@ -28,6 +28,7 @@
public class IndexedDiskElementDescriptor
implements Serializable, Comparable
{
+ /** Don't change */
private static final long serialVersionUID = -3029163572847659450L;
/** Position of the cache data entry on disk. */
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=689570&r1=689569&r2=689570&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 Wed Aug 27 12:12:06 2008
@@ -516,6 +516,9 @@
/**
* 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 )
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheAttributes.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheAttributes.java?rev=689570&r1=689569&r2=689570&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheAttributes.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheAttributes.java Wed Aug 27 12:12:06 2008
@@ -29,34 +29,46 @@
public class JDBCDiskCacheAttributes
extends AbstractDiskCacheAttributes
{
+ /** Don't change */
private static final long serialVersionUID = -6535808344813320062L;
+ /** default */
private static final String DEFAULT_TABLE_NAME = "JCS_STORE";
+ /** DB username */
private String userName;
+ /** DB password */
private String password;
+ /** URL for the db */
private String url;
+ /** The name of the database. */
private String database = "";
+ /** The driver */
private String driverClassName;
+ /** The table name */
private String tableName = DEFAULT_TABLE_NAME;
+ /** If false we will insert and if it fails we will update. */
private boolean testBeforeInsert = true;
/** This is the default limit on the maximum number of active connections. */
public static final int DEFAULT_MAX_ACTIVE = 10;
+ /** Max connections allowed */
private int maxActive = DEFAULT_MAX_ACTIVE;
/** This is the default setting for the cleanup routine. */
public static final int DEFAULT_SHRINKER_INTERVAL_SECONDS = 300;
+ /** How often should we remove expired. */
private int shrinkerIntervalSeconds = DEFAULT_SHRINKER_INTERVAL_SECONDS;
+ /** Should we remove expired in the background. */
private boolean UseDiskShrinker = true;
/**
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheFactory.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheFactory.java?rev=689570&r1=689569&r2=689570&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheFactory.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheFactory.java Wed Aug 27 12:12:06 2008
@@ -34,6 +34,7 @@
public class JDBCDiskCacheFactory
implements AuxiliaryCacheFactory
{
+ /** Name of the factory */
private String name = "JDBCDiskCacheFactory";
/**
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManager.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManager.java?rev=689570&r1=689569&r2=689570&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManager.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCacheManager.java Wed Aug 27 12:12:06 2008
@@ -24,19 +24,22 @@
import org.apache.jcs.auxiliary.AuxiliaryCache;
/**
- * This manages instances of the jdbc disk cache. It maintains one for each
- * region. One for all regions would work, but this gives us more detailed stats
- * by region.
+ * This manages instances of the jdbc disk cache. It maintains one for each region. One for all
+ * regions would work, but this gives us more detailed stats by region.
*/
public class JDBCDiskCacheManager
extends JDBCDiskCacheManagerAbstractTemplate
{
+ /** Don't change */
private static final long serialVersionUID = -8258856770927857896L;
+ /** The logger. */
private static final Log log = LogFactory.getLog( JDBCDiskCacheManager.class );
+ /** Singleton instance */
private static JDBCDiskCacheManager instance;
+ /** User configurable settings. */
private JDBCDiskCacheAttributes defaultJDBCDiskCacheAttributes;
/**
@@ -99,7 +102,8 @@
* Creates a JDBCDiskCache using the supplied attributes.
* <p>
* @param cattr
- * @return
+ * @param tableState
+ * @return AuxiliaryCache
*/
protected AuxiliaryCache createJDBCDiskCache( JDBCDiskCacheAttributes cattr, TableState tableState )
{
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCachePoolAccess.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCachePoolAccess.java?rev=689570&r1=689569&r2=689570&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCachePoolAccess.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCachePoolAccess.java Wed Aug 27 12:12:06 2008
@@ -60,10 +60,9 @@
* Configures the pool name to use for the pool access.
* <p>
* This pool name should be unique to the database. It is used as part of the URL each time we
- * lookup a conection from the driver manager.
+ * lookup a connection from the driver manager.
* <p>
* @param poolName
- * @param driverName
*/
public JDBCDiskCachePoolAccess( String poolName )
{
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/ShrinkerThread.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/ShrinkerThread.java?rev=689570&r1=689569&r2=689570&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/ShrinkerThread.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/ShrinkerThread.java Wed Aug 27 12:12:06 2008
@@ -55,8 +55,6 @@
/**
* Does nothing special.
- * <p>
- * @param diskCache
*/
protected ShrinkerThread()
{
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheFactory.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheFactory.java?rev=689570&r1=689569&r2=689570&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheFactory.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/hsql/HSQLDiskCacheFactory.java Wed Aug 27 12:12:06 2008
@@ -49,8 +49,10 @@
/** The logger */
private final static Log log = LogFactory.getLog( HSQLDiskCacheFactory.class );
+ /** Name for logging, etc. */
private String name = "HSQLDiskCacheFactory";
+ /** The databases. */
private Set databases = Collections.synchronizedSet( new HashSet() );
/**
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheManager.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheManager.java?rev=689570&r1=689569&r2=689570&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheManager.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/disk/jdbc/mysql/MySQLDiskCacheManager.java Wed Aug 27 12:12:06 2008
@@ -33,29 +33,31 @@
import org.apache.jcs.auxiliary.disk.jdbc.mysql.util.ScheduleParser;
/**
- * This manages instances of the MySQL jdbc disk cache. It maintains one for
- * each region. One for all regions would work, but this gives us more detailed
- * stats by region.
+ * This manages instances of the MySQL jdbc disk cache. It maintains one for each region. One for
+ * all regions would work, but this gives us more detailed stats by region.
* <p>
- * Although the generic JDBC Disk Cache Manager can be used for MySQL, the MySQL
- * JDBC Disk Cache has additional features, such as table optimization that are
- * particular to MySQL.
+ * Although the generic JDBC Disk Cache Manager can be used for MySQL, the MySQL JDBC Disk Cache has
+ * additional features, such as table optimization that are particular to MySQL.
*/
public class MySQLDiskCacheManager
extends JDBCDiskCacheManagerAbstractTemplate
{
+ /** Don't change. */
private static final long serialVersionUID = -8258856770927857896L;
+ /** The logger */
private static final Log log = LogFactory.getLog( MySQLDiskCacheManager.class );
+ /** The singleton instance. */
private static MySQLDiskCacheManager instance;
+ /** User configurable atributes. */
private MySQLDiskCacheAttributes defaultJDBCDiskCacheAttributes;
- // ms in a day
+ /** ms in a day */
private static final int DAILY_INTERVAL = 60 * 60 * 24 * 1000;
- // for schedule optimizations
+ /** for schedule optimizations */
private Timer daemon = null;
/**
@@ -118,7 +120,8 @@
* Creates a JDBCDiskCache using the supplied attributes.
* <p>
* @param cattr
- * @return
+ * @param tableState
+ * @return AuxiliaryCache
*/
protected AuxiliaryCache createJDBCDiskCache( JDBCDiskCacheAttributes cattr, TableState tableState )
{
@@ -130,8 +133,7 @@
}
/**
- * For each time in the optimization schedule, this calls schedule
- * Optimizaiton.
+ * For each time in the optimization schedule, this calls schedule Optimizaiton.
* <p>
* @param attributes
* @param tableState
@@ -178,11 +180,9 @@
}
/**
- * This takes in a single time and schedules the optimizer to be called at
- * that time every day.
+ * This takes in a single time and schedules the optimizer to be called at that time every day.
* <p>
- * @param startTime --
- * HH:MM:SS format
+ * @param startTime -- HH:MM:SS format
* @param optimizer
*/
protected void scheduleOptimization( Date startTime, MySQLTableOptimizer optimizer )
@@ -213,14 +213,14 @@
}
/**
- * This calls the optimizers' optimize table method. This is used by the
- * timer.
+ * This calls the optimizers' optimize table method. This is used by the timer.
* <p>
* @author Aaron Smuts
*/
private class OptimizerTask
extends TimerTask
{
+ /** Handles optimization */
private MySQLTableOptimizer optimizer = null;
/**
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCache.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCache.java?rev=689570&r1=689569&r2=689570&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCache.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCache.java Wed Aug 27 12:12:06 2008
@@ -81,12 +81,16 @@
/** This is a handle on the remote server. In zombie mode it is replaced with a balking facade. */
private IRemoteCacheService remote;
+ /** The listener */
private IRemoteCacheListener listener;
+ /** Default element attribures */
private IElementAttributes attr = null;
+ /** A thread pool for gets if configured. */
private ThreadPool pool = null;
+ /** Should we get asynchonously using a pool. */
private boolean usePoolForGet = false;
/**
@@ -300,6 +304,7 @@
* @param keys
* @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
+ * @throws IOException
*/
protected Map processGetMultiple( Set keys )
throws IOException
@@ -793,7 +798,6 @@
* <p>
* Protected for testing.
* <p>
- * @param requesterId
* @return String
*/
protected String getIPAddressForService()
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFactory.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFactory.java?rev=689570&r1=689569&r2=689570&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFactory.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFactory.java Wed Aug 27 12:12:06 2008
@@ -42,8 +42,10 @@
public class RemoteCacheFactory
implements AuxiliaryCacheFactory
{
+ /** The logger. */
private final static Log log = LogFactory.getLog( RemoteCacheFactory.class );
+ /** The name of this auxiliary */
private String name;
/** store reference of facades to initiate failover */
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFailoverRunner.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFailoverRunner.java?rev=689570&r1=689569&r2=689570&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFailoverRunner.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheFailoverRunner.java Wed Aug 27 12:12:06 2008
@@ -49,12 +49,16 @@
public class RemoteCacheFailoverRunner
implements Runnable
{
+ /** The logger */
private final static Log log = LogFactory.getLog( RemoteCacheFailoverRunner.class );
+ /** The facade returned to the composite cache. */
private RemoteCacheNoWaitFacade facade;
+ /** How long to wait between reconnect attempts. */
private static long idlePeriod = 20 * 1000;
+ /** Have we reconnected. */
private boolean alright = true;
/** The cache manager */
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheListener.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheListener.java?rev=689570&r1=689569&r2=689570&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheListener.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheListener.java Wed Aug 27 12:12:06 2008
@@ -50,12 +50,16 @@
public class RemoteCacheListener
implements IRemoteCacheListener, IRemoteCacheConstants, Serializable
{
+ /** Don't change */
private static final long serialVersionUID = 1L;
+ /** The logger */
private final static Log log = LogFactory.getLog( RemoteCacheListener.class );
+ /** The cached name of the local host. The remote server gets this for logging purposes. */
private static String localHostName = null;
+ /** Has this client been shutdown. */
boolean disposed = false;
/**
@@ -76,6 +80,7 @@
/** This is set by the remote cache server. */
protected long listenerId = 0;
+ /** Custom serializer. Standard by default. */
private transient IElementSerializer elementSerializer = new StandardSerializer();
/**
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheManager.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheManager.java?rev=689570&r1=689569&r2=689570&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheManager.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheManager.java Wed Aug 27 12:12:06 2008
@@ -53,24 +53,31 @@
public class RemoteCacheManager
implements AuxiliaryCacheManager, IShutdownObserver
{
+ /** Dont' change */
private static final long serialVersionUID = 798077557166389498L;
+ /** The logger */
private final static Log log = LogFactory.getLog( RemoteCacheManager.class );
/** Contains mappings of Location instance to RemoteCacheManager instance. */
final static Map instances = new HashMap();
+ /** Monitors connections. */
private static RemoteCacheMonitor monitor;
+ /** Not so useful. How many getCaches over releases were called. */
private int clients;
/** Contains instances of RemoteCacheNoWait managed by a RemoteCacheManager instance. */
final Map caches = new HashMap();
+ /** The remote host */
final String host;
+ /** The remote port */
final int port;
+ /** The service name */
final String service;
/** The configuration attributes. */
@@ -94,6 +101,7 @@
/** The cache manager listeners will need to use to get a cache. */
private ICompositeCacheManager cacheMgr;
+ /** The service found through lookup */
private String registry;
/**
@@ -410,11 +418,11 @@
IRemoteCacheClient remoteCacheClient = new RemoteCache( cattr, remoteService, listener );
remoteCacheClient.setCacheEventLogger( cacheEventLogger );
remoteCacheClient.setElementSerializer( elementSerializer );
-
+
remoteCacheNoWait = new RemoteCacheNoWait( remoteCacheClient );
remoteCacheNoWait.setCacheEventLogger( cacheEventLogger );
remoteCacheNoWait.setElementSerializer( elementSerializer );
-
+
caches.put( cattr.getCacheName(), remoteCacheNoWait );
}
@@ -551,9 +559,9 @@
this.port = port;
}
- /*
- * (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
+ /**
+ * @param obj
+ * @return true if the host and port are equal
*/
public boolean equals( Object obj )
{
@@ -585,7 +593,6 @@
/**
* Shutdown callback from composite cache manager.
* <p>
- * (non-Javadoc)
* @see org.apache.jcs.engine.behavior.IShutdownObserver#shutdown()
*/
public void shutdown()
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheRestore.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheRestore.java?rev=689570&r1=689569&r2=689570&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheRestore.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteCacheRestore.java Wed Aug 27 12:12:06 2008
@@ -32,32 +32,35 @@
* <p>
* When there is an error the monitor kicks off. The Failover runner starts looks for a manager with
* a connection to a remote cache that is not in error. If a manager's connection to a remote cache
- * is found to be in error, the restorer kicks off and tries to reconnect. When it is succesful, the
+ * is found to be in error, the restorer kicks off and tries to reconnect. When it is successful, the
* status of the manager changes.
* <p>
* When the failover runner finds that the primary is in good shape, it will switch back. Switching
- * back invovles setting the first no wait on the no wait facade.
+ * back involves setting the first no wait on the no wait facade.
*/
public class RemoteCacheRestore
implements ICacheRestore
{
+ /** The logger */
private final static Log log = LogFactory.getLog( RemoteCacheRestore.class );
- private final RemoteCacheManager rcm;
+ /** The manager */
+ private final RemoteCacheManager remoteCacheManager;
- // private final AuxiliaryCacheManager rcm;
+ /** can it be restored */
private boolean canFix = true;
+ /** The remote handle */
private Object remoteObj;
/**
* Constructs with the given instance of RemoteCacheManager.
+ * <p>
* @param rcm
*/
public RemoteCacheRestore( RemoteCacheManager rcm )
{
- // public RemoteCacheRestore(AuxiliaryCacheManager rcm) {
- this.rcm = rcm;
+ this.remoteCacheManager = rcm;
}
/**
@@ -72,7 +75,7 @@
{
return canFix;
}
- String registry = "//" + rcm.host + ":" + rcm.port + "/" + rcm.service;
+ String registry = "//" + remoteCacheManager.host + ":" + remoteCacheManager.port + "/" + remoteCacheManager.service;
if ( log.isInfoEnabled() )
{
log.info( "looking up server " + registry );
@@ -87,7 +90,7 @@
}
catch ( Exception ex )
{
- log.error( "host=" + rcm.host + "; port" + rcm.port + "; service=" + rcm.service );
+ log.error( "host=" + remoteCacheManager.host + "; port" + remoteCacheManager.port + "; service=" + remoteCacheManager.service );
canFix = false;
}
return canFix;
@@ -102,11 +105,11 @@
{
return;
}
- rcm.fixCaches( (IRemoteCacheService) remoteObj, (IRemoteCacheObserver) remoteObj );
+ remoteCacheManager.fixCaches( (IRemoteCacheService) remoteObj, (IRemoteCacheObserver) remoteObj );
if ( log.isInfoEnabled() )
{
- String msg = "Remote connection to " + "//" + rcm.host + ":" + rcm.port + "/" + rcm.service + " resumed.";
+ String msg = "Remote connection to " + "//" + remoteCacheManager.host + ":" + remoteCacheManager.port + "/" + remoteCacheManager.service + " resumed.";
log.info( msg );
}
}
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteUtils.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteUtils.java?rev=689570&r1=689569&r2=689570&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteUtils.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/RemoteUtils.java Wed Aug 27 12:12:06 2008
@@ -37,6 +37,7 @@
*/
public class RemoteUtils
{
+ /** The logger. */
private final static Log log = LogFactory.getLog( RemoteUtils.class );
/** No instances please. */
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/ZombieRemoteCacheService.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/ZombieRemoteCacheService.java?rev=689570&r1=689569&r2=689570&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/ZombieRemoteCacheService.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/ZombieRemoteCacheService.java Wed Aug 27 12:12:06 2008
@@ -35,8 +35,9 @@
import org.apache.jcs.utils.timing.ElapsedTimer;
/**
- * Zombie adapter for the remote cache service. It just balks if there is no queue configured. If a
- * queue is configured, then events will be added to the queue. The idea is that when proper
+ * Zombie adapter for the remote cache service. It just balks if there is no queue configured.
+ * <p>
+ * If a queue is configured, then events will be added to the queue. The idea is that when proper
* operation is restored, the remote cache will walk the queue. The queue must be bounded so it does
* not eat memory.
* <p>
@@ -48,10 +49,13 @@
extends ZombieCacheService
implements IRemoteCacheService
{
+ /** The logger */
private final static Log log = LogFactory.getLog( ZombieRemoteCacheService.class );
+ /** How big can the queue grow. */
private int maxQueueSize = 0;
+ /** The queue */
private BoundedQueue queue;
/**
@@ -152,10 +156,10 @@
}
/**
- * @param cacheName
+ * @param cacheName
* @param keys
- * @param requesterId
- * @return an empty map. zombies have no internal data
+ * @param requesterId
+ * @return an empty map. zombies have no internal data
*/
public Map getMultiple( String cacheName, Set keys, long requesterId )
{
@@ -222,8 +226,10 @@
*/
private abstract class ZombieEvent
{
+ /** The name of the region. */
String cacheName;
+ /** The id of the requester */
long requesterId;
}
@@ -233,6 +239,7 @@
private class PutEvent
extends ZombieEvent
{
+ /** The element to put */
ICacheElement element;
/**
@@ -253,6 +260,7 @@
private class RemoveEvent
extends ZombieEvent
{
+ /** The key to remove */
Serializable key;
/**
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=689570&r1=689569&r2=689570&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 Aug 27 12:12:06 2008
@@ -93,6 +93,7 @@
/** relates listener id with an ip address */
private final Hashtable idIPMap = new Hashtable();
+ /** Used to get the next listener id. */
private int[] listenerId = new int[1];
/** Configuration settings. */
@@ -231,7 +232,6 @@
* <p>
* @param item
* @param requesterId
- * @throws IOException
*/
private void processUpdate( ICacheElement item, long requesterId )
{
@@ -434,7 +434,6 @@
* @param key
* @param requesterId
* @return ICacheElement
- * @throws IOException
*/
private ICacheElement processGet( String cacheName, Serializable key, long requesterId )
{
@@ -486,7 +485,7 @@
* @param fromCluster
* @param cacheDesc
* @param element
- * @return
+ * @return ICacheElement
*/
private ICacheElement getFromCacheListeners( Serializable key, boolean fromCluster, CacheListeners cacheDesc,
ICacheElement element )
@@ -584,7 +583,6 @@
* @param requesterId
* @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
- * @throws IOException
*/
private Map processGetMultiple( String cacheName, Set keys, long requesterId )
{
@@ -630,7 +628,7 @@
* @param elements
* @param fromCluster
* @param cacheDesc
- * @return
+ * @return Map
*/
private Map getMultipleFromCacheListeners( Set keys, Map elements, boolean fromCluster, CacheListeners cacheDesc )
{
@@ -1455,6 +1453,8 @@
* <p>
* @param item
* @param requesterId
+ * @param eventName
+ * @return ICacheEvent
*/
private ICacheEvent createICacheEvent( ICacheElement item, long requesterId, String eventName )
{
@@ -1473,6 +1473,8 @@
* @param cacheName
* @param key
* @param requesterId
+ * @param eventName
+ * @return ICacheEvent
*/
private ICacheEvent createICacheEvent( String cacheName, Serializable key, long requesterId, String eventName )
{
@@ -1487,8 +1489,7 @@
/**
* Logs an event if an event logger is configured.
* <p>
- * @param item
- * @param requesterId
+ * @param cacheEvent
*/
protected void logICacheEvent( ICacheEvent cacheEvent )
{
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerAttributes.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerAttributes.java?rev=689570&r1=689569&r2=689570&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerAttributes.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerAttributes.java Wed Aug 27 12:12:06 2008
@@ -27,12 +27,16 @@
extends AbstractAuxiliaryCacheAttributes
implements IRemoteCacheServerAttributes
{
+ /** Don't change */
private static final long serialVersionUID = -2741662082869155365L;
+ /** Name of the remote service. */
private String remoteServiceName = IRemoteCacheConstants.REMOTE_CACHE_SERVICE_VAL;
+ /** The remote host. */
private String remoteHost;
+ /** The remote port. */
private int remotePort;
/**
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java?rev=689570&r1=689569&r2=689570&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheServerFactory.java Wed Aug 27 12:12:06 2008
@@ -168,7 +168,11 @@
}
}
- /** Configures the RemoteCacheServerAttributes from the props file. */
+ /** Configures the RemoteCacheServerAttributes from the props file.
+ * <p>
+ * @param propFile
+ * @return RemoteCacheServerAttributes
+ * @throws IOException */
protected static RemoteCacheServerAttributes configureServerAttributes( String propFile )
throws IOException
{
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheStartupServlet.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheStartupServlet.java?rev=689570&r1=689569&r2=689570&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheStartupServlet.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/auxiliary/remote/server/RemoteCacheStartupServlet.java Wed Aug 27 12:12:06 2008
@@ -61,12 +61,16 @@
public class RemoteCacheStartupServlet
extends HttpServlet
{
+ /** Don't change */
private static final long serialVersionUID = 1L;
+ /** The logger */
private final static Log log = LogFactory.getLog( RemoteCacheStartupServlet.class );
+ /** The default port to start the registry on. */
private static final int DEFAULT_REGISTRY_PORT = 1101;
+ /** The default config file name */
private static final String DEFAULT_PROPS_FILE_NAME = "cache.ccf";
/**
@@ -163,6 +167,11 @@
/**
* It just dumps the stats.
+ * <p>
+ * @param request
+ * @param response
+ * @throws ServletException
+ * @throws IOException
*/
protected void service( HttpServletRequest request, HttpServletResponse response )
throws ServletException, IOException
Modified: jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/BoundedQueue.java
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/BoundedQueue.java?rev=689570&r1=689569&r2=689570&view=diff
==============================================================================
--- jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/BoundedQueue.java (original)
+++ jakarta/jcs/trunk/src/java/org/apache/jcs/utils/struct/BoundedQueue.java Wed Aug 27 12:12:06 2008
@@ -26,8 +26,10 @@
*/
public class BoundedQueue
{
+ /** Queue size limit. */
private int maxSize;
+ /** The list backing the queue */
private DoubleLinkedList list = new DoubleLinkedList();
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-dev-help@jakarta.apache.org