Search in sources :

Example 1 with EnchachePool

use of io.mycat.cache.impl.EnchachePool in project Mycat-Server by MyCATApache.

the class TestCachePoolPerformance method createEnCachePool.

public static CachePool createEnCachePool() {
    CacheConfiguration cacheConf = new CacheConfiguration();
    cacheConf.setName("testcache");
    cacheConf.maxBytesLocalHeap(400, MemoryUnit.MEGABYTES).timeToIdleSeconds(3600);
    Cache cache = new Cache(cacheConf);
    CacheManager.create().addCache(cache);
    EnchachePool enCachePool = new EnchachePool(cacheConf.getName(), cache, 400 * 10000);
    return enCachePool;
}
Also used : EnchachePool(io.mycat.cache.impl.EnchachePool) CacheConfiguration(net.sf.ehcache.config.CacheConfiguration) Cache(net.sf.ehcache.Cache)

Aggregations

EnchachePool (io.mycat.cache.impl.EnchachePool)1 Cache (net.sf.ehcache.Cache)1 CacheConfiguration (net.sf.ehcache.config.CacheConfiguration)1