// Path: core/src/main/java/org/mskcc/cbio/oncokb/cache/Constants.java
// public static final String REDIS_KEY_SEPARATOR = ":";


import org.redisson.api.RedissonClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cache.Cache;
import org.springframework.cache.support.AbstractValueAdaptingCache;
import org.springframework.cache.support.SimpleValueWrapper;
import java.io.*;
import java.util.concurrent.TimeUnit;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
import static org.mskcc.cbio.oncokb.cache.Constants.REDIS_KEY_SEPARATOR;
package org.mskcc.cbio.oncokb.cache;




/**
 * @author Luke Sikina, Hongxin Zhang
 **/
public abstract class CustomRedisCache extends AbstractValueAdaptingCache {
    private static final Logger LOG = LoggerFactory.getLogger(CustomRedisCache.class);
    public static final int INFINITE_TTL = -1;

    protected final String name;
    protected final long ttlMinutes;
    protected final RedissonClient store;

    /**
     * Create a new ConcurrentMapCache with the specified name.
     * @param name the name of the cache
     */
    public CustomRedisCache(String name, RedissonClient client, long ttlMinutes) {
        super(true);
        this.name = name;
        this.store = client;
        this.ttlMinutes = ttlMinutes;
    }

    @Override
    public final String getName() {
        return name;
    }

    @Override
    public final RedissonClient getNativeCache() {
        return this.store;
    }

    @Override
    protected Object lookup(Object key) {
// Path: core/src/main/java/org/mskcc/cbio/oncokb/cache/Constants.java
// public static final String REDIS_KEY_SEPARATOR = ":";


// Path: core/src/main/java/org/mskcc/cbio/oncokb/cache/CustomRedisCache.java
import org.redisson.api.RedissonClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cache.Cache;
import org.springframework.cache.support.AbstractValueAdaptingCache;
import org.springframework.cache.support.SimpleValueWrapper;
import java.io.*;
import java.util.concurrent.TimeUnit;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
import static org.mskcc.cbio.oncokb.cache.Constants.REDIS_KEY_SEPARATOR;

package org.mskcc.cbio.oncokb.cache;




/**
 * @author Luke Sikina, Hongxin Zhang
 **/
public abstract class CustomRedisCache extends AbstractValueAdaptingCache {
    private static final Logger LOG = LoggerFactory.getLogger(CustomRedisCache.class);
    public static final int INFINITE_TTL = -1;

    protected final String name;
    protected final long ttlMinutes;
    protected final RedissonClient store;

    /**
     * Create a new ConcurrentMapCache with the specified name.
     * @param name the name of the cache
     */
    public CustomRedisCache(String name, RedissonClient client, long ttlMinutes) {
        super(true);
        this.name = name;
        this.store = client;
        this.ttlMinutes = ttlMinutes;
    }

    @Override
    public final String getName() {
        return name;
    }

    @Override
    public final RedissonClient getNativeCache() {
        return this.store;
    }

    @Override
    protected Object lookup(Object key) {
        Object value = this.store.getBucket(name + REDIS_KEY_SEPARATOR + key).get();