/** * Dump the cache entries from first to last for debugging. */ public void dumpCacheEntries() { dumpMap(); }
/** * For post reflection creation initialization * <p> * @param hub */ @Override public void initialize( CompositeCache<K, V> hub ) { super.initialize( hub ); log.info( "initialized LHMLRUMemoryCache for " + getCacheName() ); }
/** * Put half the max and clear. get the key array and verify that it has the correct number of * items. * <p> * @throws Exception */ public void testGetKeyArray() throws Exception { CompositeCacheManager cacheMgr = CompositeCacheManager.getUnconfiguredInstance(); cacheMgr.configure( "/TestLHMLRUCache.ccf" ); CompositeCache<String, String> cache = cacheMgr.getCache( "testGetKeyArray" ); LHMLRUMemoryCache<String, String> mru = new LHMLRUMemoryCache<String, String>(); mru.initialize( cache ); int max = cache.getCacheAttributes().getMaxObjects(); int items = max / 2; for ( int i = 0; i < items; i++ ) { ICacheElement<String, String> ice = new CacheElement<String, String>( cache.getCacheName(), i + ":key", cache.getCacheName() + " data " + i ); ice.setElementAttributes( cache.getElementAttributes() ); mru.update( ice ); } Set<String> keys = mru.getKeySet(); assertEquals( "Wrong number of keys.", items, keys.size() ); }
/** * Put half the max and clear. get the key array and verify that it has the correct number of * items. * <p> * @throws Exception */ public void testGetKeyArray() throws Exception { CompositeCacheManager cacheMgr = CompositeCacheManager.getUnconfiguredInstance(); cacheMgr.configure( "/TestLHMLRUCache.ccf" ); CompositeCache<String, String> cache = cacheMgr.getCache( "testGetKeyArray" ); LHMLRUMemoryCache<String, String> mru = new LHMLRUMemoryCache<String, String>(); mru.initialize( cache ); int max = cache.getCacheAttributes().getMaxObjects(); int items = max / 2; for ( int i = 0; i < items; i++ ) { ICacheElement<String, String> ice = new CacheElement<String, String>( cache.getCacheName(), i + ":key", cache.getCacheName() + " data " + i ); ice.setElementAttributes( cache.getElementAttributes() ); mru.update( ice ); } Set<String> keys = mru.getKeySet(); assertEquals( "Wrong number of keys.", items, keys.size() ); }
/** * Dump the cache entries from first to last for debugging. */ public void dumpCacheEntries() { dumpMap(); }
log.debug( "getting item from cache " + getCacheName() + " for key " + key ); if ( log.isDebugEnabled() ) log.debug( getCacheName() + ": LHMLRUMemoryCache hit for " + key ); if ( log.isDebugEnabled() ) log.debug( getCacheName() + ": LHMLRUMemoryCache miss for " + key );