private void doLoad(final Ehcache cache) { CacheManager manager = cache.getCacheManager(); if (manager == null) { throw new CacheException("Cache must belong to a cache manager to bootstrap"); } DiskStorePathManager pathManager = diskStorePathManager != null ? diskStorePathManager : cache.getCacheManager() .getDiskStorePathManager(); final RotatingSnapshotFile snapshotFile = new RotatingSnapshotFile(pathManager, cache.getName(), manager.getConfiguration().getClassLoader()); try { final Set<Object> keys = snapshotFile.readAll(); int loaded = 0; for (Object key : keys) { if (isInMemoryLimitReached(cache, loaded)) { break; } cache.get(key); loaded++; } LOG.info("Finished loading {} keys (of {} on disk) from previous snapshot for Cache '{}'", new Object[] {Integer.valueOf(loaded), keys.size(), cache.getName()}); } catch (IOException e) { LOG.error("Couldn't load keySet for Cache '{}'", cache.getName(), e); } if (doKeySnapshot) { keySnapshotter = new KeySnapshotter(cache, interval, doKeySnapshotOnDedicatedThread, snapshotFile); } }
this.diskStorePathManager = cache.getCacheManager().getDiskStorePathManager(); this.file = diskStorePathManager.getFile(cache.getName(), ".data");
private void doLoad(final Ehcache cache) { CacheManager manager = cache.getCacheManager(); if (manager == null) { throw new CacheException("Cache must belong to a cache manager to bootstrap"); } DiskStorePathManager pathManager = diskStorePathManager != null ? diskStorePathManager : cache.getCacheManager() .getDiskStorePathManager(); final RotatingSnapshotFile snapshotFile = new RotatingSnapshotFile(pathManager, cache.getName()); try { final Set<Object> keys = snapshotFile.readAll(); int loaded = 0; for (Object key : keys) { if (isInMemoryLimitReached(cache, loaded)) { break; } cache.get(key); loaded++; } LOG.info("Finished loading {} keys (of {} on disk) from previous snapshot for Cache '{}'", new Object[] {Integer.valueOf(loaded), keys.size(), cache.getName()}); } catch (IOException e) { LOG.error("Couldn't load keySet for Cache '{}'", cache.getName(), e); } if (doKeySnapshot) { keySnapshotter = new KeySnapshotter(cache, interval, doKeySnapshotOnDedicatedThread, snapshotFile); } }
private void doLoad(final Ehcache cache) { CacheManager manager = cache.getCacheManager(); if (manager == null) { throw new CacheException("Cache must belong to a cache manager to bootstrap"); } DiskStorePathManager pathManager = diskStorePathManager != null ? diskStorePathManager : cache.getCacheManager() .getDiskStorePathManager(); final RotatingSnapshotFile snapshotFile = new RotatingSnapshotFile(pathManager, cache.getName(), manager.getConfiguration().getClassLoader()); try { final Set<Object> keys = snapshotFile.readAll(); int loaded = 0; for (Object key : keys) { if (isInMemoryLimitReached(cache, loaded)) { break; } cache.get(key); loaded++; } LOG.info("Finished loading {} keys (of {} on disk) from previous snapshot for Cache '{}'", new Object[] {Integer.valueOf(loaded), keys.size(), cache.getName()}); } catch (IOException e) { LOG.error("Couldn't load keySet for Cache '{}'", cache.getName(), e); } if (doKeySnapshot) { keySnapshotter = new KeySnapshotter(cache, interval, doKeySnapshotOnDedicatedThread, snapshotFile); } }
private void doLoad(final Ehcache cache) { CacheManager manager = cache.getCacheManager(); if (manager == null) { throw new CacheException("Cache must belong to a cache manager to bootstrap"); } DiskStorePathManager pathManager = diskStorePathManager != null ? diskStorePathManager : cache.getCacheManager() .getDiskStorePathManager(); final RotatingSnapshotFile snapshotFile = new RotatingSnapshotFile(pathManager, cache.getName(), manager.getConfiguration().getClassLoader()); try { final Set<Object> keys = snapshotFile.readAll(); int loaded = 0; for (Object key : keys) { if (isInMemoryLimitReached(cache, loaded)) { break; } cache.get(key); loaded++; } LOG.info("Finished loading {} keys (of {} on disk) from previous snapshot for Cache '{}'", new Object[] {Integer.valueOf(loaded), keys.size(), cache.getName()}); } catch (IOException e) { LOG.error("Couldn't load keySet for Cache '{}'", cache.getName(), e); } if (doKeySnapshot) { keySnapshotter = new KeySnapshotter(cache, interval, doKeySnapshotOnDedicatedThread, snapshotFile); } }
this.diskStorePathManager = cache.getCacheManager().getDiskStorePathManager(); this.file = diskStorePathManager.getFile(cache.getName(), ".data");
this.diskStorePathManager = cache.getCacheManager().getDiskStorePathManager(); this.file = diskStorePathManager.getFile(cache.getName(), ".data");
this.diskStorePathManager = cache.getCacheManager().getDiskStorePathManager(); this.file = diskStorePathManager.getFile(cache.getName(), ".data");