From d320b78ae1fd8250e089bb8fb3d9b8095ec3d5d2 Mon Sep 17 00:00:00 2001 From: James Agnew Date: Mon, 4 Oct 2021 05:46:06 -0400 Subject: [PATCH] Improve synthea ingest performance (#3033) * Improve synthea ingest performance * Tweaks * Fix param splitting * Update to test * Add changelog * Test fix * Add some runtime checks * Remove useless test * Test fix --- .../executor/BaseInterceptorService.java | 4 +- .../java/ca/uhn/fhir/util/FhirTerser.java | 10 +- ...id-repeated-match-url-lookups-in-xact.yaml | 6 + .../jpa/dao/TransactionProcessorTest.java | 10 +- .../r4/FhirResourceDaoR4QueryCountTest.java | 153 +++++++++++++++- .../jpa/provider/r4/SystemProviderR4Test.java | 26 +++ .../extractor/BaseSearchParamExtractor.java | 14 +- .../BaseSearchParamExtractorTest.java | 20 +++ .../fhir/jpa/dao/MatchResourceUrlService.java | 7 +- .../uhn/fhir/jpa/util/MemoryCacheService.java | 13 +- .../fhir/rest/client/GenericClientR4Test.java | 1 + pom.xml | 170 +++++++++--------- 12 files changed, 329 insertions(+), 105 deletions(-) create mode 100644 hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/3033-avoid-repeated-match-url-lookups-in-xact.yaml create mode 100644 hapi-fhir-jpaserver-searchparam/src/test/java/ca/uhn/fhir/jpa/searchparam/extractor/BaseSearchParamExtractorTest.java diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/executor/BaseInterceptorService.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/executor/BaseInterceptorService.java index e21040f888d..e2b3adacb3c 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/executor/BaseInterceptorService.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/interceptor/executor/BaseInterceptorService.java @@ -402,7 +402,9 @@ public abstract class BaseInterceptorService impleme * Only call this when assertions are enabled, it's expensive */ boolean haveAppropriateParams(POINTCUT thePointcut, HookParams theParams) { - Validate.isTrue(theParams.getParamsForType().values().size() == thePointcut.getParameterTypes().size(), "Wrong number of params for pointcut %s - Wanted %s but found %s", thePointcut.name(), toErrorString(thePointcut.getParameterTypes()), theParams.getParamsForType().values().stream().map(t -> t != null ? t.getClass().getSimpleName() : "null").sorted().collect(Collectors.toList())); + if (theParams.getParamsForType().values().size() != thePointcut.getParameterTypes().size()) { + throw new IllegalArgumentException(String.format("Wrong number of params for pointcut %s - Wanted %s but found %s", thePointcut.name(), toErrorString(thePointcut.getParameterTypes()), theParams.getParamsForType().values().stream().map(t -> t != null ? t.getClass().getSimpleName() : "null").sorted().collect(Collectors.toList()))); + } List wantedTypes = new ArrayList<>(thePointcut.getParameterTypes()); diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/FhirTerser.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/FhirTerser.java index 00d0026ffbb..75eaf91a349 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/FhirTerser.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/FhirTerser.java @@ -964,7 +964,9 @@ public class FhirTerser { BaseRuntimeElementDefinition def = theDefinition; if (def.getChildType() == ChildTypeEnum.CONTAINED_RESOURCE_LIST) { - def = myContext.getElementDefinition(theElement.getClass()); + Class clazz = theElement.getClass(); + def = myContext.getElementDefinition(clazz); + Validate.notNull(def, "Unable to find element definition for class: %s", clazz); } if (theElement instanceof IBaseReference) { @@ -1009,10 +1011,12 @@ public class FhirTerser { continue; } BaseRuntimeElementDefinition childElementDef; - childElementDef = nextChild.getChildElementDefinitionByDatatype(nextValue.getClass()); + Class clazz = nextValue.getClass(); + childElementDef = nextChild.getChildElementDefinitionByDatatype(clazz); if (childElementDef == null) { - childElementDef = myContext.getElementDefinition(nextValue.getClass()); + childElementDef = myContext.getElementDefinition(clazz); + Validate.notNull(childElementDef, "Unable to find element definition for class: %s", clazz); } if (nextChild instanceof RuntimeChildDirectResource) { diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/3033-avoid-repeated-match-url-lookups-in-xact.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/3033-avoid-repeated-match-url-lookups-in-xact.yaml new file mode 100644 index 00000000000..b483d9e1457 --- /dev/null +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/5_6_0/3033-avoid-repeated-match-url-lookups-in-xact.yaml @@ -0,0 +1,6 @@ +--- +type: perf +issue: 3033 +title: "When performing a FHIR transaction using the JPA server where the transaction contains many + identical inline match URLs (as is the case with recent versions of Synthea), HAPI FHIR will now + avoid repeateed identical lookups while processing the transaction." diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/TransactionProcessorTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/TransactionProcessorTest.java index eb3ea13a1b1..c680025b866 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/TransactionProcessorTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/TransactionProcessorTest.java @@ -15,14 +15,21 @@ import ca.uhn.fhir.jpa.searchparam.MatchUrlService; import ca.uhn.fhir.jpa.searchparam.matcher.InMemoryResourceMatcher; import ca.uhn.fhir.jpa.searchparam.matcher.SearchParamMatcher; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; +import ca.uhn.fhir.util.BundleBuilder; import org.hibernate.Session; import org.hibernate.internal.SessionImpl; +import org.hl7.fhir.dstu3.model.IdType; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.MedicationKnowledge; +import org.hl7.fhir.r4.model.Observation; +import org.hl7.fhir.r4.model.Patient; +import org.hl7.fhir.r4.model.Reference; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Answers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Bean; @@ -47,6 +54,7 @@ import static org.mockito.Mockito.when; @ContextConfiguration(classes = TransactionProcessorTest.MyConfig.class) public class TransactionProcessorTest { + private static final Logger ourLog = LoggerFactory.getLogger(TransactionProcessorTest.class); @Autowired private TransactionProcessor myTransactionProcessor; @MockBean @@ -75,9 +83,9 @@ public class TransactionProcessorTest { private IResourceVersionSvc myResourceVersionSvc; @MockBean private SearchParamMatcher mySearchParamMatcher; - @MockBean(answer = Answers.RETURNS_DEEP_STUBS) private SessionImpl mySession; + private FhirContext myFhirCtx = FhirContext.forR4Cached(); @BeforeEach public void before() { diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4QueryCountTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4QueryCountTest.java index 580cb632e94..f1e925a3348 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4QueryCountTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4QueryCountTest.java @@ -22,8 +22,10 @@ import org.hl7.fhir.r4.model.CodeableConcept; import org.hl7.fhir.r4.model.Coding; import org.hl7.fhir.r4.model.Coverage; import org.hl7.fhir.r4.model.DateTimeType; +import org.hl7.fhir.r4.model.Encounter; import org.hl7.fhir.r4.model.ExplanationOfBenefit; import org.hl7.fhir.r4.model.IdType; +import org.hl7.fhir.r4.model.Location; import org.hl7.fhir.r4.model.Narrative; import org.hl7.fhir.r4.model.Observation; import org.hl7.fhir.r4.model.Patient; @@ -48,7 +50,6 @@ import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.empty; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNull; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.when; @@ -895,6 +896,156 @@ public class FhirResourceDaoR4QueryCountTest extends BaseResourceProviderR4Test } + @Test + public void testTransactionWithMultipleInlineMatchUrls() { + myDaoConfig.setDeleteEnabled(false); + myDaoConfig.setMassIngestionMode(true); + myDaoConfig.setAllowInlineMatchUrlReferences(true); + myDaoConfig.setMatchUrlCacheEnabled(true); + + Location loc = new Location(); + loc.setId("LOC"); + loc.addIdentifier().setSystem("http://foo").setValue("123"); + myLocationDao.update(loc, mySrd); + + BundleBuilder bb = new BundleBuilder(myFhirCtx); + for (int i = 0; i < 5; i++) { + Encounter enc = new Encounter(); + enc.addLocation().setLocation(new Reference("Location?identifier=http://foo|123")); + bb.addTransactionCreateEntry(enc); + } + Bundle input = (Bundle) bb.getBundle(); + + myCaptureQueriesListener.clear(); + mySystemDao.transaction(mySrd, input); + myCaptureQueriesListener.logSelectQueriesForCurrentThread(); + assertEquals(2, myCaptureQueriesListener.countSelectQueriesForCurrentThread()); + assertEquals(6, runInTransaction(() -> myResourceTableDao.count())); + + // Second identical pass + + bb = new BundleBuilder(myFhirCtx); + for (int i = 0; i < 5; i++) { + Encounter enc = new Encounter(); + enc.addLocation().setLocation(new Reference("Location?identifier=http://foo|123")); + bb.addTransactionCreateEntry(enc); + } + input = (Bundle) bb.getBundle(); + + myCaptureQueriesListener.clear(); + mySystemDao.transaction(mySrd, input); + myCaptureQueriesListener.logSelectQueriesForCurrentThread(); + assertEquals(0, myCaptureQueriesListener.countSelectQueriesForCurrentThread()); + assertEquals(11, runInTransaction(() -> myResourceTableDao.count())); + + } + + + @Test + public void testTransactionWithMultipleForcedIdReferences() { + myDaoConfig.setDeleteEnabled(false); + myDaoConfig.setMassIngestionMode(true); + myDaoConfig.setAllowInlineMatchUrlReferences(true); + myDaoConfig.setMatchUrlCacheEnabled(true); + + Patient pt = new Patient(); + pt.setId("ABC"); + pt.setActive(true); + myPatientDao.update(pt); + + Location loc = new Location(); + loc.setId("LOC"); + loc.addIdentifier().setSystem("http://foo").setValue("123"); + myLocationDao.update(loc, mySrd); + + myMemoryCacheService.invalidateAllCaches(); + + BundleBuilder bb = new BundleBuilder(myFhirCtx); + for (int i = 0; i < 5; i++) { + Encounter enc = new Encounter(); + enc.setSubject(new Reference(pt.getId())); + enc.addLocation().setLocation(new Reference(loc.getId())); + bb.addTransactionCreateEntry(enc); + } + Bundle input = (Bundle) bb.getBundle(); + + myCaptureQueriesListener.clear(); + mySystemDao.transaction(mySrd, input); + myCaptureQueriesListener.logSelectQueriesForCurrentThread(); + assertEquals(2, myCaptureQueriesListener.countSelectQueriesForCurrentThread()); + assertEquals(7, runInTransaction(() -> myResourceTableDao.count())); + + // Second identical pass + + bb = new BundleBuilder(myFhirCtx); + for (int i = 0; i < 5; i++) { + Encounter enc = new Encounter(); + enc.setSubject(new Reference(pt.getId())); + enc.addLocation().setLocation(new Reference(loc.getId())); + bb.addTransactionCreateEntry(enc); + } + input = (Bundle) bb.getBundle(); + + myCaptureQueriesListener.clear(); + mySystemDao.transaction(mySrd, input); + myCaptureQueriesListener.logSelectQueriesForCurrentThread(); + assertEquals(0, myCaptureQueriesListener.countSelectQueriesForCurrentThread()); + assertEquals(12, runInTransaction(() -> myResourceTableDao.count())); + + } + + + @Test + public void testTransactionWithMultipleNumericIdReferences() { + myDaoConfig.setDeleteEnabled(false); + myDaoConfig.setMassIngestionMode(true); + myDaoConfig.setAllowInlineMatchUrlReferences(true); + myDaoConfig.setMatchUrlCacheEnabled(true); + + Patient pt = new Patient(); + pt.setActive(true); + myPatientDao.create(pt, mySrd); + + Location loc = new Location(); + loc.addIdentifier().setSystem("http://foo").setValue("123"); + myLocationDao.create(loc, mySrd); + + myMemoryCacheService.invalidateAllCaches(); + + BundleBuilder bb = new BundleBuilder(myFhirCtx); + for (int i = 0; i < 5; i++) { + Encounter enc = new Encounter(); + enc.setSubject(new Reference(pt.getId())); + enc.addLocation().setLocation(new Reference(loc.getId())); + bb.addTransactionCreateEntry(enc); + } + Bundle input = (Bundle) bb.getBundle(); + + myCaptureQueriesListener.clear(); + mySystemDao.transaction(mySrd, input); + myCaptureQueriesListener.logSelectQueriesForCurrentThread(); + assertEquals(2, myCaptureQueriesListener.countSelectQueriesForCurrentThread()); + assertEquals(7, runInTransaction(() -> myResourceTableDao.count())); + + // Second identical pass + + bb = new BundleBuilder(myFhirCtx); + for (int i = 0; i < 5; i++) { + Encounter enc = new Encounter(); + enc.setSubject(new Reference(pt.getId())); + enc.addLocation().setLocation(new Reference(loc.getId())); + bb.addTransactionCreateEntry(enc); + } + input = (Bundle) bb.getBundle(); + + myCaptureQueriesListener.clear(); + mySystemDao.transaction(mySrd, input); + myCaptureQueriesListener.logSelectQueriesForCurrentThread(); + assertEquals(0, myCaptureQueriesListener.countSelectQueriesForCurrentThread()); + assertEquals(12, runInTransaction(() -> myResourceTableDao.count())); + + } + @Test public void testTransactionWithMultipleConditionalUpdates() { diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/SystemProviderR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/SystemProviderR4Test.java index 521397b0aab..77cf37dddfa 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/SystemProviderR4Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/SystemProviderR4Test.java @@ -35,6 +35,7 @@ import ca.uhn.fhir.rest.server.provider.DeleteExpungeProvider; import ca.uhn.fhir.rest.server.provider.ProviderConstants; import ca.uhn.fhir.test.utilities.BatchJobHelper; import ca.uhn.fhir.test.utilities.JettyUtil; +import ca.uhn.fhir.util.BundleBuilder; import ca.uhn.fhir.util.BundleUtil; import ca.uhn.fhir.validation.ResultSeverityEnum; import com.google.common.base.Charsets; @@ -576,6 +577,31 @@ public class SystemProviderR4Test extends BaseJpaR4Test { } } + @Test + @Disabled("Stress test only") + public void testTransactionWithPlaceholderIds() { + + + for (int pass = 0; pass < 10000; pass++) { + BundleBuilder bb = new BundleBuilder(myFhirCtx); + for (int i = 0; i < 100; i++) { + Patient pt = new Patient(); + pt.setId(org.hl7.fhir.dstu3.model.IdType.newRandomUuid()); + pt.addIdentifier().setSystem("http://foo").setValue("val" + i); + bb.addTransactionCreateEntry(pt); + + Observation obs = new Observation(); + obs.setId(org.hl7.fhir.dstu3.model.IdType.newRandomUuid()); + obs.setSubject(new Reference(pt.getId())); + bb.addTransactionCreateEntry(obs); + } + Bundle bundle = (Bundle) bb.getBundle(); + ourLog.info("Starting pass {}", pass); + mySystemDao.transaction(null, bundle); + } + + } + @Test public void testTransactionFromBundle6() throws Exception { InputStream bundleRes = SystemProviderR4Test.class.getResourceAsStream("/simone_bundle3.xml"); diff --git a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/extractor/BaseSearchParamExtractor.java b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/extractor/BaseSearchParamExtractor.java index 3315670f03a..85cae3c0a1b 100644 --- a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/extractor/BaseSearchParamExtractor.java +++ b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/extractor/BaseSearchParamExtractor.java @@ -53,6 +53,8 @@ import com.google.common.collect.Sets; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; +import org.apache.commons.text.StringTokenizer; +import org.apache.commons.text.matcher.StringMatcher; import org.fhir.ucum.Pair; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.instance.model.api.IBase; @@ -85,7 +87,6 @@ import java.util.TreeSet; import java.util.regex.Pattern; import java.util.stream.Collectors; -import static org.apache.commons.lang3.StringUtils.defaultString; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; import static org.apache.commons.lang3.StringUtils.trim; @@ -94,7 +95,6 @@ public abstract class BaseSearchParamExtractor implements ISearchParamExtractor public static final Set COORDS_INDEX_PATHS; private static final Pattern SPLIT = Pattern.compile("\\||( or )"); - private static final Pattern SPLIT_R4 = Pattern.compile("\\s+\\|"); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(BaseSearchParamExtractor.class); static { @@ -974,7 +974,7 @@ public abstract class BaseSearchParamExtractor implements ISearchParamExtractor .filter(param -> param.getParamType() != theSearchParamType) .map(RuntimeSearchParam::getPath) .filter(Objects::nonNull) - .anyMatch(path-> path.contains("resolve")); + .anyMatch(path -> path.contains("resolve")); } /** @@ -989,7 +989,7 @@ public abstract class BaseSearchParamExtractor implements ISearchParamExtractor private void cleanUpContainedResourceReferences(IBaseResource theResource, RestSearchParameterTypeEnum theSearchParamType, Collection searchParams) { boolean havePathWithResolveExpression = myModelConfig.isIndexOnContainedResources() - || anySearchParameterUsesResolve(searchParams, theSearchParamType); + || anySearchParameterUsesResolve(searchParams, theSearchParamType); if (havePathWithResolveExpression) { //TODO GGG/JA: At this point, if the Task.basedOn.reference.resource does _not_ have an ID, we will attempt to contain it internally. Wild @@ -1549,9 +1549,13 @@ public abstract class BaseSearchParamExtractor implements ISearchParamExtractor @Nonnull public static String[] splitPathsR4(@Nonnull String thePaths) { - return SPLIT_R4.split(thePaths); + StringTokenizer tok = new StringTokenizer(thePaths, " |"); + StringMatcher trimmerMatcher = (buffer, start, bufferStart, bufferEnd) -> (buffer[start] <= 32) ? 1 : 0; + tok.setTrimmerMatcher(trimmerMatcher); + return tok.getTokenArray(); } + public static boolean tokenTextIndexingEnabledForSearchParam(ModelConfig theModelConfig, RuntimeSearchParam theSearchParam) { Optional noSuppressForSearchParam = theSearchParam.getExtensions(HapiExtensions.EXT_SEARCHPARAM_TOKEN_SUPPRESS_TEXT_INDEXING).stream() .map(IBaseExtension::getValue) diff --git a/hapi-fhir-jpaserver-searchparam/src/test/java/ca/uhn/fhir/jpa/searchparam/extractor/BaseSearchParamExtractorTest.java b/hapi-fhir-jpaserver-searchparam/src/test/java/ca/uhn/fhir/jpa/searchparam/extractor/BaseSearchParamExtractorTest.java new file mode 100644 index 00000000000..b5041cfc3ff --- /dev/null +++ b/hapi-fhir-jpaserver-searchparam/src/test/java/ca/uhn/fhir/jpa/searchparam/extractor/BaseSearchParamExtractorTest.java @@ -0,0 +1,20 @@ +package ca.uhn.fhir.jpa.searchparam.extractor; + +import org.junit.jupiter.api.Test; + +import java.util.Arrays; +import java.util.List; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.contains; +import static org.junit.jupiter.api.Assertions.*; + +class BaseSearchParamExtractorTest { + + @Test + public void testSplitPathsR4() { + List tokens = Arrays.asList(BaseSearchParamExtractor.splitPathsR4(" aaa | bbb + '|' | ccc ddd ")); + assertThat(tokens, contains("aaa", "bbb + '|'", "ccc ddd")); + + } +} diff --git a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/MatchResourceUrlService.java b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/MatchResourceUrlService.java index 9ba74bb5921..9235872bf8c 100644 --- a/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/MatchResourceUrlService.java +++ b/hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/dao/MatchResourceUrlService.java @@ -101,9 +101,12 @@ public class MatchResourceUrlService { Set retVal = search(paramMap, theResourceType, theRequest, theConditionalOperationTargetOrNull); - if (myDaoConfig.isMatchUrlCacheEnabled() && retVal.size() == 1) { + if (retVal.size() == 1) { ResourcePersistentId pid = retVal.iterator().next(); - myMemoryCacheService.putAfterCommit(MemoryCacheService.CacheEnum.MATCH_URL, matchUrl, pid); + theTransactionDetails.addResolvedMatchUrl(matchUrl, pid); + if (myDaoConfig.isMatchUrlCacheEnabled()) { + myMemoryCacheService.putAfterCommit(MemoryCacheService.CacheEnum.MATCH_URL, matchUrl, pid); + } } return retVal; 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 86b09951622..e5a3075271c 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 @@ -73,6 +73,11 @@ public class MemoryCacheService { case PID_TO_FORCED_ID: case FORCED_ID_TO_PID: case MATCH_URL: + case RESOURCE_LOOKUP: + case HISTORY_COUNT: + case TAG_DEFINITION: + case RESOURCE_CONDITIONAL_CREATE_VERSION: + default: timeoutSeconds = SECONDS.convert(1, MINUTES); maximumSize = 10000; if (myDaoConfig.isMassIngestionMode()) { @@ -80,14 +85,6 @@ public class MemoryCacheService { maximumSize = 100000; } break; - case HISTORY_COUNT: - case TAG_DEFINITION: - case RESOURCE_LOOKUP: - case RESOURCE_CONDITIONAL_CREATE_VERSION: - default: - timeoutSeconds = SECONDS.convert(1, MINUTES); - maximumSize = 10000; - break; } Cache nextCache = Caffeine.newBuilder() diff --git a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/client/GenericClientR4Test.java b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/client/GenericClientR4Test.java index 5bc58a5894d..1eb1a5caf74 100644 --- a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/client/GenericClientR4Test.java +++ b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/rest/client/GenericClientR4Test.java @@ -2166,6 +2166,7 @@ public class GenericClientR4Test extends BaseGenericClientR4Test { } + @Test public void testUpdateById() throws Exception { IParser p = ourCtx.newXmlParser(); diff --git a/pom.xml b/pom.xml index fb8d1b3c045..3360d1ac633 100644 --- a/pom.xml +++ b/pom.xml @@ -755,101 +755,103 @@ - + - 5.4.10 - 1.0.3 + 5.4.10 + 1.0.3 - -Dfile.encoding=UTF-8 -Xmx2048m + -Dfile.encoding=UTF-8 -Xmx2048m - - yyyy-MM-dd'T'HH:mm:ss'Z' + + yyyy-MM-dd'T'HH:mm:ss'Z' - UTF-8 + UTF-8 - - ${user.home}/sites/hapi-fhir - ${user.home}/sites/scm/hapi-fhir + + ${user.home}/sites/hapi-fhir + ${user.home}/sites/scm/hapi-fhir - - 1.2.0 - 4.2.5 - 1.2 - 2.9.1 - 1.15 - 1.21 - 1.9 - 2.8.0 - 3.12.0 - 1.2 - 1.5.0 - 10.14.2.0 - - 2.5.1 - 3.9.0 - 0.7.9 - 30.1.1-jre - 2.8.6 - 2.2.11_1 - 2.3.1 - 2.3.0.1 - 3.0.0 - 3.17.0 - 3.0.0 - 9.4.43.v20210629 - 3.0.2 - 5.7.1 - 0.50.40 - 6.5.4 - 5.4.30.Final - 6.0.3.Final - - 8.7.0 - 2.2 - 6.1.5.Final - 4.4.13 - 4.5.13 - 2.12.3 - ${jackson_version} - 3.3.0 - 1.8 - 3.8.1 - 4.1.2 - 1.4 - 4.0.0.Beta3 - 5.6.5 - 9.5.4 - 2.8.8 - 9.8.0-15 - 1.2_5 - 1.7.30 - 2.11.1 - 5.3.7 - 2.5.0 - 4.3.3 - 2.5.0 - 1.2.2.RELEASE + + 1.2.0 + 4.2.5 + 1.2 + 2.9.1 + 1.15 + 1.21 + 1.9 + 2.8.0 + 3.12.0 + 1.2 + 1.5.0 + 10.14.2.0 + + 2.5.1 + 3.9.0 + 0.7.9 + 30.1.1-jre + 2.8.6 + 2.2.11_1 + 2.3.1 + 2.3.0.1 + 3.0.0 + 3.17.0 + 3.0.0 + 9.4.43.v20210629 + 3.0.2 + 5.7.1 + 0.50.40 + 6.5.4 + 5.4.30.Final + 6.0.3.Final + + 8.7.0 + 2.2 + 6.1.5.Final + 4.4.13 + 4.5.13 + 2.12.3 + ${jackson_version} + 3.3.0 + 1.8 + 3.8.1 + 4.1.2 + 1.4 + 4.0.0.Beta3 + 5.6.5 + 9.5.4 + 2.8.8 + 9.8.0-15 + 1.2_5 + 1.7.30 + 2.11.1 + 5.3.7 + 2.5.0 + 4.3.3 + 2.5.0 + 1.2.2.RELEASE - 3.1.4 - 1.15.3 - 3.0.12.RELEASE - 4.4.1 + 3.1.4 + 1.15.3 + 3.0.12.RELEASE + 4.4.1 - - 1.6.0 + + 1.6.0 - UTF-8 - 1.0.1 + UTF-8 + 1.0.1 - 1.13.0 - - 1.5.1 - 1.2.0 - 1.5.2 + 1.13.0 + + 1.5.1 + 1.2.0 + 1.5.2 - - 5.4.1 - + + 5.4.1 + 11 + 11 +