class BigCache implements ICache<K> {

	public BigCache(String dir, CacheConfig config) throws IOException {
		this.cacheDir = dir;
		if (!this.cacheDir.endsWith(File.separator)) {
			this.cacheDir += File.separator;
		}
		// validate directory
		if (!FileUtil.isFilenameValid(this.cacheDir)) {
			throw new IllegalArgumentException("Invalid cache data directory : " + this.cacheDir);
		}
		
		// clean up old cache data if exists
		FileUtil.deleteDirectory(new File(this.cacheDir));
		
		this.storageManager = new StorageManager(this.cacheDir, config.getCapacityPerBlock(),
				config.getInitialNumberOfBlocks(), config.getStorageMode(), config.getMaxOffHeapMemorySize());
		this.readWriteLock = new StripedReadWriteLock(config.getConcurrencyLevel());

        ses = new ScheduledThreadPoolExecutor(2);
        ses.scheduleWithFixedDelay(new CacheCleaner(this), config.getPurgeInterval(), config.getPurgeInterval(), TimeUnit.MILLISECONDS);
        ses.scheduleWithFixedDelay(new CacheMerger(this), config.getMergeInterval(), config.getMergeInterval(), TimeUnit.MILLISECONDS);
        dirtyRatioThreshold = config.getDirtyRatioThreshold();
	}

	public  BigCache(String dir, CacheConfig config);

}