class OffHeapCache extends AbstractSearchableCache<K, V> {

  protected void initCache(OffHeapByteBufferStore byteBufferStore, Serializer<V> serializer,
      long bufferCleanerPeriod, final float bufferCleanerThreshold, int concurrencyLevel) {
    if (concurrencyLevel > 11 || concurrencyLevel < 0) {
      throw new IllegalArgumentException("ConcurrencyLevel must be between 0 and 11 inclusive!");
    }
    this.serializer = serializer;
    this.bufferStore = byteBufferStore;
    this.readWriteLock = new StripedReadWriteLock(concurrencyLevel);
    final ScheduledExecutorService cleanerService = Executors
        .newSingleThreadScheduledExecutor(runnable -> {
          String threadName = "imcache:bufferCleanerService(name=" + getName() + ",thread="
              + NO_OF_CLEANERS.incrementAndGet() + ")";
          return ThreadUtils.createDaemonThread(runnable, threadName);
        });
    cleanerService
        .scheduleAtFixedRate(() -> cleanBuffers(bufferCleanerThreshold), bufferCleanerPeriod,
            bufferCleanerPeriod, TimeUnit.MILLISECONDS);
    final ScheduledExecutorService evictionService = Executors
        .newSingleThreadScheduledExecutor(runnable -> {
          String threadName = "imcache:evictionService(name=" + getName() + ",thread="
              + NO_OF_EVICTORS.incrementAndGet() + ")";
          return ThreadUtils.createDaemonThread(runnable, threadName);
        });
    evictionService.scheduleAtFixedRate(() -> doEviction(), bufferCleanerPeriod, evictionPeriod,
        TimeUnit.MILLISECONDS);
  }

  public  OffHeapCache(final String name, final CacheLoader<K, V> cacheLoader,
      final EvictionListener<K, V> evictionListener,
      final IndexHandler<K, V> indexHandler, final OffHeapByteBufferStore byteBufferStore,
      final Serializer<V> serializer,
      final long bufferCleanerPeriod, final float bufferCleanerThreshold,
      final int concurrencyLevel,
      final long evictionPeriod);

}