@Override public <C extends Configuration<K, V>> C getConfiguration(Class<C> aClass) { return cache.getConfiguration(aClass); }
private void populateLocalCacheEntrySet(ICache<K, T> cache) { cacheEntryList = new ConcurrentSkipListSet<>(); Iterator<Cache.Entry<K, T>> cacheEntryIterator = cache.iterator(); while (cacheEntryIterator.hasNext()) { cacheEntryList.add(cacheEntryIterator.next().getKey()); } cacheConfig = cache.getConfiguration(CacheConfig.class); LOG.info("Populated local cache entry set with respect to remote cache provider."); }
private void populateLocalCacheEntrySet(ICache<K, T> cache) { cacheEntryList = new ConcurrentSkipListSet<>(); Iterator<Cache.Entry<K, T>> cacheEntryIterator = cache.iterator(); while (cacheEntryIterator.hasNext()) { cacheEntryList.add(cacheEntryIterator.next().getKey()); } cacheConfig = cache.getConfiguration(CacheConfig.class); LOG.info("Populated local cache entry set with respect to remote cache provider."); }
@Setup public void setup() { value = new byte[valueSize]; Random random = new Random(); random.nextBytes(value); CacheManager cacheManager = createCacheManager(targetInstance); cache = (ICache<Object, Object>) cacheManager.getCache(name); CacheConfig<Object, Object> config = cache.getConfiguration(CacheConfig.class); logger.info(name + ": " + cache.getName() + " config: " + config); configuredMaxSize = config.getEvictionConfig().getSize(); // we are explicitly using a random key so that all participants of the test do not put keys 0...max // the size of putAllMap is not guarantied to be configuredMaxSize / 2 as keys are random for (int i = 0; i < configuredMaxSize / 2; i++) { putAllMap.put(random.nextInt(), value); } if (configuredMaxSize < 1000) { toleranceFactor = TOLERANCE_FACTOR_SMALL; } else if (configuredMaxSize < 10000) { toleranceFactor = TOLERANCE_FACTOR_MEDIUM; } else { toleranceFactor = TOLERANCE_FACTOR_LARGE; } estimatedMaxSize = (int) (configuredMaxSize * toleranceFactor); }
CacheConfig cacheConfig = cache.getConfiguration(CacheConfig.class);
CacheConfig cacheConfig = cache.getConfiguration(CacheConfig.class); Iterable<CacheEntryListenerConfiguration> cacheEntryListenerConfigurations = cacheConfig.getCacheEntryListenerConfigurations();
CacheConfig cacheConfig = cache.getConfiguration(CacheConfig.class);