From e41bb4829a2829b60500f03a12eb0c23e24fc0b1 Mon Sep 17 00:00:00 2001 From: Benjamin Preiser Date: Tue, 18 Jun 2024 12:11:48 -0400 Subject: [PATCH 1/5] bump spring version to implicitly support HEAD --- .../cbio/oncokb/cache/CustomRedisCache.java | 19 +++++++++++++++++++ pom.xml | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/mskcc/cbio/oncokb/cache/CustomRedisCache.java b/core/src/main/java/org/mskcc/cbio/oncokb/cache/CustomRedisCache.java index bfb4aa77f..8e13101b4 100644 --- a/core/src/main/java/org/mskcc/cbio/oncokb/cache/CustomRedisCache.java +++ b/core/src/main/java/org/mskcc/cbio/oncokb/cache/CustomRedisCache.java @@ -9,6 +9,7 @@ import org.springframework.cache.support.SimpleValueWrapper; import java.io.*; +import java.util.concurrent.Callable; import java.util.concurrent.TimeUnit; import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; @@ -168,4 +169,22 @@ protected Object fromStoreValue(Object storeValue) { protected Cache.ValueWrapper toValueWrapper(Object storeValue) { return (storeValue != null ? new SimpleValueWrapper(storeValue) : null); } + + @Override + @SuppressWarnings("unchecked") + public T get(Object key, Callable valueLoader) { + ValueWrapper storeValue = get(key); + if (storeValue != null) { + return (T) storeValue.get(); + } + + T value; + try { + value = valueLoader.call(); + } catch (Throwable ex) { + throw new ValueRetrievalException(key, valueLoader, ex); + } + put(key, value); + return value; + } } diff --git a/pom.xml b/pom.xml index dde670c00..9090f5f1c 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.mskcc.cbio.oncokb master - 3.18.2 + 3.18.3 pom web @@ -14,7 +14,7 @@ 1.8 UTF-8 3.6.10.Final - 4.2.2.RELEASE + 4.3.30.RELEASE 1.8 1.8 From 52e7ff42af0f146f228b9a6ab60df4b486df4056 Mon Sep 17 00:00:00 2001 From: bprize15 Date: Fri, 21 Jun 2024 11:27:26 -0400 Subject: [PATCH 2/5] add sync caching get method --- .../main/java/org/mskcc/cbio/oncokb/cache/CustomRedisCache.java | 2 ++ pom.xml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/mskcc/cbio/oncokb/cache/CustomRedisCache.java b/core/src/main/java/org/mskcc/cbio/oncokb/cache/CustomRedisCache.java index 8e13101b4..6dbb808bb 100644 --- a/core/src/main/java/org/mskcc/cbio/oncokb/cache/CustomRedisCache.java +++ b/core/src/main/java/org/mskcc/cbio/oncokb/cache/CustomRedisCache.java @@ -173,6 +173,8 @@ protected Cache.ValueWrapper toValueWrapper(Object storeValue) { @Override @SuppressWarnings("unchecked") public T get(Object key, Callable valueLoader) { + LOG.warn("Sync method was enabled for cacheable. We do not currently support synchronized caching, so this is most likely a mistake."); + ValueWrapper storeValue = get(key); if (storeValue != null) { return (T) storeValue.get(); diff --git a/pom.xml b/pom.xml index 9090f5f1c..c14ff92b1 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.mskcc.cbio.oncokb master - 3.18.3 + 3.18.0 pom web From 8bfc62cda6eb4c42855305a99c2e6dc60b59c76f Mon Sep 17 00:00:00 2001 From: bprize15 Date: Fri, 21 Jun 2024 11:30:25 -0400 Subject: [PATCH 3/5] fix version number --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c14ff92b1..9090f5f1c 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.mskcc.cbio.oncokb master - 3.18.0 + 3.18.3 pom web From 48fe9b466ee5224fa3b9d361ee4aad4d4fb5af7a Mon Sep 17 00:00:00 2001 From: bprize15 Date: Fri, 21 Jun 2024 11:31:39 -0400 Subject: [PATCH 4/5] change version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9090f5f1c..94e96783b 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.mskcc.cbio.oncokb master - 3.18.3 + 3.18.2 pom web From 2a563bab70b01f4c5e8dbfc6ffde28037abf3fc0 Mon Sep 17 00:00:00 2001 From: bprize15 Date: Fri, 21 Jun 2024 11:41:58 -0400 Subject: [PATCH 5/5] add comment --- .../main/java/org/mskcc/cbio/oncokb/cache/CustomRedisCache.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/main/java/org/mskcc/cbio/oncokb/cache/CustomRedisCache.java b/core/src/main/java/org/mskcc/cbio/oncokb/cache/CustomRedisCache.java index 6dbb808bb..d56da4dea 100644 --- a/core/src/main/java/org/mskcc/cbio/oncokb/cache/CustomRedisCache.java +++ b/core/src/main/java/org/mskcc/cbio/oncokb/cache/CustomRedisCache.java @@ -173,6 +173,7 @@ protected Cache.ValueWrapper toValueWrapper(Object storeValue) { @Override @SuppressWarnings("unchecked") public T get(Object key, Callable valueLoader) { + // see https://docs.spring.io/spring-framework/docs/4.3.9.RELEASE/spring-framework-reference/html/cache.html#cache-annotations-cacheable-synchronized LOG.warn("Sync method was enabled for cacheable. We do not currently support synchronized caching, so this is most likely a mistake."); ValueWrapper storeValue = get(key);