From e339e049771fc656472ccea2b308b1074b3a6809 Mon Sep 17 00:00:00 2001 From: Alok Joshi Date: Tue, 13 Oct 2020 09:46:55 -0500 Subject: [PATCH 1/5] add separate config for Azure redis cluster --- pom.xml | 2 +- .../osdu/core/common/cache/RedisCache.java | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0011653..41ce99f 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.opengroup.osdu os-core-common - 0.3.13 + 0.3.14-SNAPSHOT jar diff --git a/src/main/java/org/opengroup/osdu/core/common/cache/RedisCache.java b/src/main/java/org/opengroup/osdu/core/common/cache/RedisCache.java index 97b60ee..65509da 100644 --- a/src/main/java/org/opengroup/osdu/core/common/cache/RedisCache.java +++ b/src/main/java/org/opengroup/osdu/core/common/cache/RedisCache.java @@ -41,10 +41,24 @@ public class RedisCache implements ICache, AutoCloseable { expireLengthSeconds = expTimeSeconds; } + public RedisCache(String host, int port, String password, int expTimeSeconds, int database, + Class classOfK, Class classOfV) { + RedisURI uri = RedisURI.Builder.redis(host, port).withTimeout(expTimeSeconds, TimeUnit.SECONDS).withPassword(password).withDatabase(database).withSsl(true).build(); + client = RedisClient.create(uri); + connection = client.connect( + CompressionCodec.valueCompressor(new JsonCodec<>(classOfK, classOfV), CompressionCodec.CompressionType.GZIP), uri); + commands = connection.sync(); + expireLengthSeconds = expTimeSeconds; + } + public RedisCache(String host, int port, int expTimeSeconds, Class classOfK, Class classOfV) { this(host, port, expTimeSeconds, 0, classOfK, classOfV); } + public RedisCache(String host, int port, String password, int expTimeSeconds, Class classOfK, Class classOfV) { + this(host, port, password, expTimeSeconds, 0, classOfK, classOfV); + } + @Override public void put(K key, V value) { SetArgs args = new SetArgs(); -- GitLab From f0f6d542b679a3fd7e662bfb1658583fde2d5a35 Mon Sep 17 00:00:00 2001 From: Alok Joshi Date: Tue, 13 Oct 2020 12:23:32 -0500 Subject: [PATCH 2/5] change pom version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 41ce99f..75358ef 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.opengroup.osdu os-core-common - 0.3.14-SNAPSHOT + 0.3.14 jar -- GitLab From 2d9f5c2bf7a0dc814642232c4ed30620f45aa471 Mon Sep 17 00:00:00 2001 From: Alok Joshi Date: Tue, 13 Oct 2020 15:32:38 -0500 Subject: [PATCH 3/5] upgrade pom version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d869e8c..055f88e 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.opengroup.osdu os-core-common - 0.3.14 + 0.3.15 jar -- GitLab From 8d7ffba547f2ca6e7e597b0160172667fc2f4604 Mon Sep 17 00:00:00 2001 From: Alok Joshi Date: Wed, 14 Oct 2020 11:02:28 -0500 Subject: [PATCH 4/5] remove unnecessary parameter from conect command --- .../java/org/opengroup/osdu/core/common/cache/RedisCache.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/opengroup/osdu/core/common/cache/RedisCache.java b/src/main/java/org/opengroup/osdu/core/common/cache/RedisCache.java index 65509da..b9c9dbe 100644 --- a/src/main/java/org/opengroup/osdu/core/common/cache/RedisCache.java +++ b/src/main/java/org/opengroup/osdu/core/common/cache/RedisCache.java @@ -46,7 +46,7 @@ public class RedisCache implements ICache, AutoCloseable { RedisURI uri = RedisURI.Builder.redis(host, port).withTimeout(expTimeSeconds, TimeUnit.SECONDS).withPassword(password).withDatabase(database).withSsl(true).build(); client = RedisClient.create(uri); connection = client.connect( - CompressionCodec.valueCompressor(new JsonCodec<>(classOfK, classOfV), CompressionCodec.CompressionType.GZIP), uri); + CompressionCodec.valueCompressor(new JsonCodec<>(classOfK, classOfV), CompressionCodec.CompressionType.GZIP)); commands = connection.sync(); expireLengthSeconds = expTimeSeconds; } -- GitLab From 9f194cd457214621e0010457b70379b6c4052ab9 Mon Sep 17 00:00:00 2001 From: Alok Joshi Date: Wed, 14 Oct 2020 17:50:02 -0500 Subject: [PATCH 5/5] rebase and upgrade pom version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 055f88e..d0b4177 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.opengroup.osdu os-core-common - 0.3.15 + 0.3.16 jar -- GitLab