import javax.cache.Cache

import grizzled.slf4j.Logging
import org.apache.ignite.cache.store.CacheStoreAdapter


class CacheJdbcPlacebo[K,V] extends CacheStoreAdapter[K, V]  with Logging {

  override def load(key: K): V = {
    if (key.asInstanceOf[Int] % 1000 == 0) logger.info(s"Loading $key ... ")
    "foo".asInstanceOf[V]
  }

  override def write(entry: Cache.Entry[_ <: K, _ <: V]): Unit = {
    logger.info(s"Writing ${entry.getKey} ...")
    logger.info(s"Done writing ${entry.getKey}")
  }

  override def delete(key: Any): Unit = {
    logger.info(s"Deleting $key ... ")
    logger.info(s"Done deleting $key")
  }

}
