asmuts 02/01/18 14:40:13
Modified: src/conf cache.ccf
src/java/org/apache/stratum/jcs/auxiliary/disk/jisp
JISPCache.java
Log:
testing disk and jisp, formatting.
jisp seems very slow for groups. need to finish error file usage for jisp.
Revision Changes Path
1.6 +2 -2 jakarta-turbine-stratum/src/conf/cache.ccf
Index: cache.ccf
===================================================================
RCS file: /home/cvs/jakarta-turbine-stratum/src/conf/cache.ccf,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- cache.ccf 18 Jan 2002 21:54:14 -0000 1.5
+++ cache.ccf 18 Jan 2002 22:40:13 -0000 1.6
@@ -62,12 +62,12 @@
# HSQL Disk Cache -- too slow as is
jcs.auxiliary.HDC=org.apache.stratum.jcs.auxiliary.disk.hsql.HSQLCacheFactory
jcs.auxiliary.HDC.attributes=org.apache.stratum.jcs.auxiliary.disk.hsql.HSQLCacheAttributes
-jcs.auxiliary.HDC.attributes.DiskPath=@project_home@/hsql
+jcs.auxiliary.HDC.attributes.DiskPath=@project_home_f@hsql
# JISP Disk Cache -- save memory with disk key storage
jcs.auxiliary.JDC=org.apache.stratum.jcs.auxiliary.disk.jisp.JISPCacheFactory
jcs.auxiliary.JDC.attributes=org.apache.stratum.jcs.auxiliary.disk.jisp.JISPCacheAttributes
-jcs.auxiliary.JDC.attributes.DiskPath=@project_home@/raf/
+jcs.auxiliary.JDC.attributes.DiskPath=@project_home_f@raf/
jcs.auxiliary.JDC.attributes.ClearOnStart=false
# need to make put or invalidate an option
1.9 +79 -29
jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/jisp/JISPCache.java
Index: JISPCache.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/auxiliary/disk/jisp/JISPCache.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- JISPCache.java 17 Jan 2002 23:08:16 -0000 1.8
+++ JISPCache.java 18 Jan 2002 22:40:13 -0000 1.9
@@ -1,12 +1,58 @@
+package org.apache.stratum.jcs.auxiliary.disk.jisp;
+
/*
- * Copyright (C) The Apache Software Foundation. All rights reserved.
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if
+ * any, must include the following acknowlegement:
+ * "This product includes software developed by the
+ * Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowlegement may appear in the software itself,
+ * if and wherever such third-party acknowlegements normally appear.
*
- * This software is published under the terms of the Apache Software License
- * version 1.1, a copy of which has been included with this distribution in
- * the LICENSE file.
+ * 4. The names "The Jakarta Project", "Velocity", and "Apache Software
+ * Foundation" must not be used to endorse or promote products derived
+ * from this software without prior written permission. For written
+ * permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this software may not be called "Apache"
+ * nor may "Apache" appear in their names without prior written
+ * permission of the Apache Group.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
*/
-package org.apache.stratum.jcs.auxiliary.disk.jisp;
-
import com.coyotegulch.jisp.BTreeIndex;
import com.coyotegulch.jisp.IndexedObjectDatabase;
import com.coyotegulch.jisp.KeyObject;
@@ -31,10 +77,12 @@
////////////////////////////////////////////////////////////////////////
/**
- * Description of the Class
+ * JISP disk cache implementation.
*
- *@author asmuts
+ *@author <a href="mailto:[EMAIL PROTECTED]">Aaron Smuts</a>
*@created January 15, 2002
+ *@version $Id: ILateralCacheTCPListener.java,v 1.2 2002/01/18 22:08:26
+ * asmuts Exp $
*/
public class JISPCache implements ICache, Serializable
{
@@ -149,15 +197,14 @@
try
{
- createDB( cattr.getClearOnStart() );
+ createDB( cattr.getClearOnStart() );
}
catch ( Exception e )
{
- log.error(e);
- reset();
+ log.error( e );
+ reset();
}
-
isAlive = true;
}
@@ -166,6 +213,7 @@
p( "QueryTool.init: " + e.getMessage() );
e.printStackTrace();
log.error( e );
+ reset();
}
}
@@ -501,7 +549,8 @@
//reset();
}
finally
- {}
+ {
+ }
}
// end removeAll
@@ -525,14 +574,14 @@
// Move to error directory, someone else must be using the file.
try
{
- this.jispDataFileName += ".error";
- this.jispIndexFileName += ".error";
- setupTABLE();
- createDB( true );
+ this.jispDataFileName += ".error";
+ this.jispIndexFileName += ".error";
+ setupTABLE();
+ createDB( true );
}
catch ( Exception e2 )
{
- log.error( e2, "Could not create error files!" );
+ log.error( e2, "Could not create error files!" );
}
}
}
@@ -559,21 +608,23 @@
public void dispose()
{
- if (!isAlive)
- {
- log.logIt("is not alive and close() was called -- " +
this.jispDataFileName);
- return;
+ if ( !isAlive )
+ {
+ log.logIt( "is not alive and close() was called -- " +
this.jispDataFileName );
+ return;
}
try
{
- database.close();
+ database.close();
}
- catch (Exception e)
+ catch ( Exception e )
+ {
+ log.error( e );
+ }
+ finally
{
- log.error(e);
- } finally {
- isAlive = false;
+ isAlive = false;
}
// TODO: can we defragment here?
@@ -581,7 +632,6 @@
}
// end dispose
-
/**
* Returns the cache status.
*
@@ -621,7 +671,7 @@
*/
public void dump()
{
- // TODO: not sure this is possible with JISP
+ // TODO: not sure this is possible with JISP
// log.debug("keyHash.size()=" + keyHash.size());
// for (Iterator itr = keyHash.entrySet().iterator(); itr.hasNext();) {
// Map.Entry e = (Map.Entry)itr.next();
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>