jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Akture, Alper" <Alper.Akt...@disney.com>
Subject RE: Unable to get the stored Cache
Date Fri, 01 May 2009 16:13:32 GMT
I'm going to take a stab, and say maybe it's because MaxObjects=0 for
your region. I'm not sure, but maybe disk cache is only used for
overflow, and can't be used they way you're trying to? Just a guess
though.

Alper

-----Original Message-----
From: Sent: Friday, May 01, 2009 6:37 AM
To: jcs-users@jakarta.apache.org
Subject: Re: Unable to get the stored Cache


I am posting the running Example of the Application.

import java.io.IOException;
import java.util.Date;
import java.util.Hashtable;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.jcs.JCS;
import org.apache.jcs.access.exception.CacheException;

public class TestHashMemory {

    static JCS jcs = null;

    public void createHashTable(long hashsize) {
        try {
            jcs = JCS.getInstance("myregion");
            Hashtable objHash = new Hashtable();
            Date date = new Date();
            long start = date.getTime();//
            for (long i = 1; i <= hashsize; i++) {
                jcs.put("key" + i, i);
            }
            Date date1 = new Date();
            long end = date1.getTime();
            System.out.println("Time taken for creation : " + (end -
start));
            date = new Date();
            start = date.getTime();
            int missing = 0;
            for (long i = 1; i <= hashsize; i++) {
                Object obj = jcs.get("key" + i);
                if (obj == null) {
                    missing++;
                }
                System.out.println(obj);
            }
            System.out.println("Total Missing Objects: " + missing);
            date1 = new Date();
            end = date1.getTime();
            System.out.println("Time taken for read : " + (end -
start));
        } catch (Exception ex) {
            ex.printStackTrace();
        }


    }

    public static void main(String a[]) {
        try {
            TestHashMemory objTestHash = new TestHashMemory();
            objTestHash.createHashTable(2000);
            System.out.println("Press any key to exit");
            System.in.read();
        } catch (IOException ex) {
           
Logger.getLogger(TestHashMemory.class.getName()).log(Level.SEVERE, null,
ex);
        }
    }
}

############## - cache.ccf - ######################################
##############################################################
##### Default Region Configuration
jcs.default=DC
jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttribut
es
jcs.default.cacheattributes.MaxObjects=0
jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory
.lru.LRUMemoryCache



##############################################################
##### CACHE REGIONS
jcs.region.myRegion1=DC
jcs.region.myRegion1.cacheattributes=org.apache.jcs.engine.CompositeCach
eAttributes
jcs.region.myRegion1.cacheattributes.MaxObjects=0
jcs.region.myRegion1.cacheattributes.MemoryCacheName=org.apache.jcs.engi
ne.memory.lru.LRUMemoryCache
jcs.region.myRegion1.cacheattributes.MaxSpoolPerRun=1000



##############################################################
##### AUXILIARY CACHES
# Indexed Disk Cache
jcs.auxiliary.DC=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheF
actory
jcs.auxiliary.DC.attributes=org.apache.jcs.auxiliary.disk.indexed.Indexe
dDiskCacheAttributes
jcs.auxiliary.DC.attributes.DiskPath=target/test-sandbox/indexed-disk-ca
che
jcs.auxiliary.DC.attributes.MaxPurgatorySize=10000
jcs.auxiliary.DC.attributes.MaxKeySize=1000
jcs.auxiliary.DC.attributes.MaxRecycleBinSize=5000
jcs.auxiliary.DC.attributes.OptimizeAtRemoveCount=300000
jcs.auxiliary.DC.attributes.OptimizeOnShutdown=true
jcs.auxiliary.DC.attributes.EventQueueType=POOLED
jcs.auxiliary.DC.attributes.EventQueuePoolName=disk_cache_event_queue

##############################################################
################## OPTIONAL THREAD POOL CONFIGURATION ########

# Disk Cache Event Queue Pool
thread_pool.disk_cache_event_queue.useBoundary=false
thread_pool.remote_cache_client.maximumPoolSize=15
thread_pool.disk_cache_event_queue.minimumPoolSize=1
thread_pool.disk_cache_event_queue.keepAliveTime=3500
thread_pool.disk_cache_event_queue.startUpSize=1


##############################################################

I am using jcs-1.3.jar, and running the application of java6.

-- 
View this message in context:
http://www.nabble.com/Unable-to-get-the-stored-Cache-tp23331442p23333219
.html
Sent from the JCS - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-users-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-users-help@jakarta.apache.org


Mime
View raw message