Commit 4aeb8998 authored by Bill Wang's avatar Bill Wang
Browse files

update

parent 844fbd36
......@@ -14,6 +14,9 @@
package org.opengroup.osdu.search.provider.aws.cache;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.opengroup.osdu.core.aws.cache.AwsElasticCache;
import org.opengroup.osdu.core.aws.ssm.K8sParameterNotFoundException;
import org.opengroup.osdu.core.common.cache.ICache;
import org.opengroup.osdu.core.common.cache.RedisCache;
import org.opengroup.osdu.core.common.provider.interfaces.IIndexCache;
......@@ -25,12 +28,8 @@ public class IndexCacheImpl implements IIndexCache<String, Boolean>, AutoCloseab
private ICache<String, Boolean> cache;
private Boolean local;
public IndexCacheImpl(@Value("${aws.elasticache.cluster.index.endpoint}") final String REDIS_SEARCH_HOST,
@Value("${aws.elasticache.cluster.index.port}") final String REDIS_SEARCH_PORT,
@Value("${aws.elasticache.cluster.index.key}") final String REDIS_SEARCH_KEY,
@Value("${aws.elasticache.cluster.index.expiration}") final String INDEX_CACHE_EXPIRATION) {
cache = new RedisCache<>(REDIS_SEARCH_HOST, Integer.parseInt(REDIS_SEARCH_PORT), REDIS_SEARCH_KEY,
Integer.parseInt(INDEX_CACHE_EXPIRATION) * 60, String.class, Boolean.class);
public IndexCacheImpl(@Value("${aws.elasticache.cluster.index.expiration}") final String INDEX_CACHE_EXPIRATION) throws K8sParameterNotFoundException, JsonProcessingException {
cache = cache = AwsElasticCache.RedisCache(Integer.parseInt(INDEX_CACHE_EXPIRATION) * 60, String.class, Boolean.class);
local = cache.getClass() != RedisCache.class;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment