Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Open Subsurface Data Universe Software
Platform
System
Search
Commits
4aeb8998
Commit
4aeb8998
authored
Aug 20, 2021
by
Bill Wang
Browse files
update
parent
844fbd36
Changes
1
Hide whitespace changes
Inline
Side-by-side
provider/search-aws/src/main/java/org/opengroup/osdu/search/provider/aws/cache/IndexCacheImpl.java
View file @
4aeb8998
...
...
@@ -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
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment