From 3acc95d45b947a1cf2de073929e13dc5b7c8e140 Mon Sep 17 00:00:00 2001 From: David Raeside <132376220+davidraeside@users.noreply.github.com> Date: Wed, 16 Oct 2024 12:37:56 -0400 Subject: [PATCH] 7.5.0 snapshot midcycle branch mergeback (#6371) * 6323 resource creation deadlock (#6324) * make map reads concurrent * change log * CUstom version number for guaranteed build determinism * licenses * Expand translation cache (#6341) * Expand translation cache * Add changelog * Correction to #6341 (#6342) --------- Co-authored-by: JasonRoberts-smile <85363818+JasonRoberts-smile@users.noreply.github.com> Co-authored-by: Tadgh Co-authored-by: James Agnew --- .../changelog/7_6_0/6341-expand-translation-cache.yaml | 6 ++++++ .../java/ca/uhn/fhir/jpa/util/MemoryCacheService.java | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_6_0/6341-expand-translation-cache.yaml diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_6_0/6341-expand-translation-cache.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_6_0/6341-expand-translation-cache.yaml new file mode 100644 index 00000000000..e0e592c0d4a --- /dev/null +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_6_0/6341-expand-translation-cache.yaml @@ -0,0 +1,6 @@ +--- +type: change +issue: 6341 +title: "The CachingValidationSupport cache for concept translations will + now keep up to 500000 translations instead of the previous 5000. + This will be made configurable in a future release." diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/util/MemoryCacheService.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/util/MemoryCacheService.java index 8df91adfa23..81b0871b91b 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/util/MemoryCacheService.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/util/MemoryCacheService.java @@ -68,7 +68,7 @@ public class MemoryCacheService { case CONCEPT_TRANSLATION_REVERSE: timeoutSeconds = SECONDS.convert(myStorageSettings.getTranslationCachesExpireAfterWriteInMinutes(), MINUTES); - maximumSize = 10000; + maximumSize = 500000; break; case PID_TO_FORCED_ID: case FORCED_ID_TO_PID: @@ -200,6 +200,12 @@ public class MemoryCacheService { * Value type: {@literal Optional} */ PID_TO_FORCED_ID(Long.class), + /** + * TODO: JA this is duplicate with the CachingValidationSupport cache. + * A better solution would be to drop this cache for this item, and to + * create a new CachingValidationSupport implementation which uses + * the MemoryCacheService for all of its caches. + */ CONCEPT_TRANSLATION(TranslationQuery.class), MATCH_URL(String.class), CONCEPT_TRANSLATION_REVERSE(TranslationQuery.class),