diff --git a/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/TestUtil.java b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/TestUtil.java index d2a54c0b224..818d209cdbf 100644 --- a/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/TestUtil.java +++ b/hapi-fhir-jpa/src/main/java/ca/uhn/fhir/jpa/util/TestUtil.java @@ -70,7 +70,7 @@ import static org.apache.commons.lang3.StringUtils.isBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank; public class TestUtil { - public static final int MAX_COL_LENGTH = 2000; + public static final int MAX_COL_LENGTH = 4000; private static final int MAX_LENGTH = 30; private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(TestUtil.class); private static Set ourReservedWords; diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/SyntheaPerfTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/SyntheaPerfTest.java index ab497f89751..6e4afae1312 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/SyntheaPerfTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/SyntheaPerfTest.java @@ -7,6 +7,7 @@ import ca.uhn.fhir.jpa.config.TestR4Config; import ca.uhn.fhir.jpa.config.TestR4WithLuceneDisabledConfig; import ca.uhn.fhir.jpa.dao.BaseJpaTest; import ca.uhn.fhir.jpa.model.entity.ResourceEncodingEnum; +import ca.uhn.fhir.jpa.partition.SystemRequestDetails; import ca.uhn.fhir.jpa.search.reindex.BlockPolicy; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.util.FileUtil; @@ -177,26 +178,26 @@ public class SyntheaPerfTest extends BaseJpaTest { throw new InternalErrorException(e); } - int resCount = 0; - int totalBytes = 0; - int maxBytes = 0; - int countOver5kb = 0; - for (Bundle.BundleEntryComponent nextEntry : bundle.getEntry()) { - int size = myCtx.newJsonParser().setPrettyPrint(false).encodeResourceToString(nextEntry.getResource()).length(); - resCount++; - totalBytes += size; - if (size > maxBytes) { - maxBytes = size; - } - if (size > 5000) { - countOver5kb++; - } - } - int avg = (int) ((double)totalBytes / (double) resCount); - ourLog.info("Resources {} Average {} Max {} CountOver5 {}", resCount, FileUtil.formatFileSize(avg), FileUtil.formatFileSize(maxBytes), countOver5kb); +// int resCount = 0; +// int totalBytes = 0; +// int maxBytes = 0; +// int countOver5kb = 0; +// for (Bundle.BundleEntryComponent nextEntry : bundle.getEntry()) { +// int size = myCtx.newJsonParser().setPrettyPrint(false).encodeResourceToString(nextEntry.getResource()).length(); +// resCount++; +// totalBytes += size; +// if (size > maxBytes) { +// maxBytes = size; +// } +// if (size > 10000) { +// countOver5kb++; +// } +// } +// int avg = (int) ((double)totalBytes / (double) resCount); +// ourLog.info("Resources {} Average {} Max {} CountOver {}", resCount, FileUtil.formatFileSize(avg), FileUtil.formatFileSize(maxBytes), countOver5kb); -// mySystemDao.transaction(new SystemRequestDetails(myInterceptorRegistry), bundle); + mySystemDao.transaction(new SystemRequestDetails(myInterceptorRegistry), bundle); int fileCount = myFilesCounter.incrementAndGet(); myResourcesCounter.addAndGet(bundle.getEntry().size()); diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceHistoryTable.java b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceHistoryTable.java index 89b1145df0f..c7c921e322d 100644 --- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceHistoryTable.java +++ b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceHistoryTable.java @@ -43,6 +43,7 @@ import javax.persistence.OneToMany; import javax.persistence.OneToOne; import javax.persistence.SequenceGenerator; import javax.persistence.Table; +import javax.persistence.Transient; import javax.persistence.UniqueConstraint; import java.io.Serializable; import java.util.ArrayList; @@ -67,7 +68,7 @@ public class ResourceHistoryTable extends BaseHasResource implements Serializabl @SuppressWarnings("WeakerAccess") public static final int ENCODING_COL_LENGTH = 5; public static final String HFJ_RES_VER = "HFJ_RES_VER"; - public static final int RES_TEXT_VC_MAX_LENGTH = 5000; + public static final int RES_TEXT_VC_MAX_LENGTH = 4000; private static final long serialVersionUID = 1L; @Id @SequenceGenerator(name = "SEQ_RESOURCE_HISTORY_ID", sequenceName = "SEQ_RESOURCE_HISTORY_ID") @@ -95,9 +96,13 @@ public class ResourceHistoryTable extends BaseHasResource implements Serializabl @Lob() @OptimisticLock(excluded = true) private byte[] myResource; - @Column(name = "RES_TEXT_VC", length = RES_TEXT_VC_MAX_LENGTH, nullable = true) - @OptimisticLock(excluded = true) + + // TODO: JA For future use or removal + // @Column(name = "RES_TEXT_VC", length = RES_TEXT_VC_MAX_LENGTH, nullable = true) + // @OptimisticLock(excluded = true) + @Transient private String myResourceTextVc; + @Column(name = "RES_ENCODING", nullable = false, length = ENCODING_COL_LENGTH) @Enumerated(EnumType.STRING) @OptimisticLock(excluded = true)