Examples of MostRecentlyUsedEvictionAlgorithm


Examples of org.wso2.carbon.clustering.hazelcast.jsr107.eviction.MostRecentlyUsedEvictionAlgorithm

        CacheManager cacheManager = Caching.getCacheManagerFactory().getCacheManager("testMRUCacheEviction-manager");
        String cacheName = "testMRUCacheEviction";
        Cache<String, Integer> cache = cacheManager.getCache(cacheName);

        ((CacheImpl) cache).setCapacity(2);
        ((CacheImpl) cache).setEvictionAlgorithm(new MostRecentlyUsedEvictionAlgorithm());

        String key1 = "key1";
        String key2 = "key2";
        String key3 = "key3";
        int value1 = 9876;
View Full Code Here

Examples of org.wso2.carbon.clustering.hazelcast.jsr107.eviction.MostRecentlyUsedEvictionAlgorithm

          description = "")
    public void testDefaultMRUCacheEviction() {
        CacheManager cacheManager = Caching.getCacheManagerFactory().getCacheManager("testDefaultMRUCacheEviction-manager");
        String cacheName = "testDefaultMRUCacheEviction";
        Cache<String, Integer> cache = cacheManager.getCache(cacheName);
        ((CacheImpl) cache).setEvictionAlgorithm(new MostRecentlyUsedEvictionAlgorithm());
        for (int i = 0; i < 10000; i++) {
            cache.put("key" + i, i);
        }
        assertEquals(((CacheImpl) cache).getAll().size(), CachingConstants.DEFAULT_CACHE_CAPACITY);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.