Commit b38f4e2c authored by Mingyang Zhu's avatar Mingyang Zhu
Browse files

remove search cursor cache failure fallback

parent 5ea8f25a
......@@ -14,12 +14,9 @@
package org.opengroup.osdu.search.provider.azure.cache.impl;
import com.lambdaworks.redis.RedisException;
import org.opengroup.osdu.core.common.cache.ICache;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.model.search.CursorSettings;
import org.opengroup.osdu.search.cache.CursorCache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
......@@ -27,35 +24,26 @@ import javax.annotation.Resource;
@Component
public class CursorCacheImpl implements CursorCache {
@Resource(name = "cursorCache")
private ICache<String, CursorSettings> cache;
@Resource(name = "cursorCache")
private ICache<String, CursorSettings> cache;
@Autowired
private JaxRsDpsLog log;
@Override
public void put(String s, CursorSettings o) {
this.cache.put(s, o);
}
@Override
public CursorSettings get(String s) {
return this.cache.get(s);
}
@Override
public void put(String s, CursorSettings o) {
this.cache.put(s, o);
}
@Override
public void delete(String s) {
this.cache.delete(s);
}
@Override
public CursorSettings get(String s) {
CursorSettings cursorSettings = null;
try {
cursorSettings = this.cache.get(s);
} catch (RedisException ex) {
this.log.error(String.format("Error getting key %s from redis: %s", s, ex.getMessage()));
@Override
public void clearAll() {
this.cache.clearAll();
}
return cursorSettings;
}
@Override
public void delete(String s) {
this.cache.delete(s);
}
@Override
public void clearAll() {
this.cache.clearAll();
}
}
......@@ -46,7 +46,7 @@ public class ElasticCredentialsCacheImpl extends ElasticCredentialsCache {
try {
cursorSettings = this.cache.get(s);
} catch (RedisException ex) {
this.log.error(String.format("Error getting key %s from redis: %s", s, ex.getMessage()));
this.log.error(String.format("Error getting key %s from redis: %s", s, ex.getMessage()), ex);
}
return cursorSettings;
}
......
......@@ -141,7 +141,7 @@ public class EntitlementsAndCacheServiceImpl implements IEntitlementsExtensionSe
try {
groups = this.cache.get(cacheKey);
} catch (RedisException ex) {
this.logger.error(String.format("Error getting key %s from redis: %s", cacheKey, ex.getMessage()));
this.logger.error(String.format("Error getting key %s from redis: %s", cacheKey, ex.getMessage()), ex);
}
if (groups == null) {
......
Supports Markdown
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