Fix accidental commit

This commit is contained in:
jamesagnew 2021-12-07 14:55:16 -05:00
parent 8aef580aed
commit 90d05a9ed4
3 changed files with 28 additions and 22 deletions

View File

@ -70,7 +70,7 @@ import static org.apache.commons.lang3.StringUtils.isBlank;
import static org.apache.commons.lang3.StringUtils.isNotBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank;
public class TestUtil { 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 int MAX_LENGTH = 30;
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(TestUtil.class); private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(TestUtil.class);
private static Set<String> ourReservedWords; private static Set<String> ourReservedWords;

View File

@ -7,6 +7,7 @@ import ca.uhn.fhir.jpa.config.TestR4Config;
import ca.uhn.fhir.jpa.config.TestR4WithLuceneDisabledConfig; import ca.uhn.fhir.jpa.config.TestR4WithLuceneDisabledConfig;
import ca.uhn.fhir.jpa.dao.BaseJpaTest; import ca.uhn.fhir.jpa.dao.BaseJpaTest;
import ca.uhn.fhir.jpa.model.entity.ResourceEncodingEnum; 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.jpa.search.reindex.BlockPolicy;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import ca.uhn.fhir.util.FileUtil; import ca.uhn.fhir.util.FileUtil;
@ -177,26 +178,26 @@ public class SyntheaPerfTest extends BaseJpaTest {
throw new InternalErrorException(e); throw new InternalErrorException(e);
} }
int resCount = 0; // int resCount = 0;
int totalBytes = 0; // int totalBytes = 0;
int maxBytes = 0; // int maxBytes = 0;
int countOver5kb = 0; // int countOver5kb = 0;
for (Bundle.BundleEntryComponent nextEntry : bundle.getEntry()) { // for (Bundle.BundleEntryComponent nextEntry : bundle.getEntry()) {
int size = myCtx.newJsonParser().setPrettyPrint(false).encodeResourceToString(nextEntry.getResource()).length(); // int size = myCtx.newJsonParser().setPrettyPrint(false).encodeResourceToString(nextEntry.getResource()).length();
resCount++; // resCount++;
totalBytes += size; // totalBytes += size;
if (size > maxBytes) { // if (size > maxBytes) {
maxBytes = size; // maxBytes = size;
} // }
if (size > 5000) { // if (size > 10000) {
countOver5kb++; // countOver5kb++;
} // }
} // }
int avg = (int) ((double)totalBytes / (double) resCount); // int avg = (int) ((double)totalBytes / (double) resCount);
ourLog.info("Resources {} Average {} Max {} CountOver5 {}", resCount, FileUtil.formatFileSize(avg), FileUtil.formatFileSize(maxBytes), countOver5kb); // 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(); int fileCount = myFilesCounter.incrementAndGet();
myResourcesCounter.addAndGet(bundle.getEntry().size()); myResourcesCounter.addAndGet(bundle.getEntry().size());

View File

@ -43,6 +43,7 @@ import javax.persistence.OneToMany;
import javax.persistence.OneToOne; import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator; import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint; import javax.persistence.UniqueConstraint;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
@ -67,7 +68,7 @@ public class ResourceHistoryTable extends BaseHasResource implements Serializabl
@SuppressWarnings("WeakerAccess") @SuppressWarnings("WeakerAccess")
public static final int ENCODING_COL_LENGTH = 5; public static final int ENCODING_COL_LENGTH = 5;
public static final String HFJ_RES_VER = "HFJ_RES_VER"; 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; private static final long serialVersionUID = 1L;
@Id @Id
@SequenceGenerator(name = "SEQ_RESOURCE_HISTORY_ID", sequenceName = "SEQ_RESOURCE_HISTORY_ID") @SequenceGenerator(name = "SEQ_RESOURCE_HISTORY_ID", sequenceName = "SEQ_RESOURCE_HISTORY_ID")
@ -95,9 +96,13 @@ public class ResourceHistoryTable extends BaseHasResource implements Serializabl
@Lob() @Lob()
@OptimisticLock(excluded = true) @OptimisticLock(excluded = true)
private byte[] myResource; 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; private String myResourceTextVc;
@Column(name = "RES_ENCODING", nullable = false, length = ENCODING_COL_LENGTH) @Column(name = "RES_ENCODING", nullable = false, length = ENCODING_COL_LENGTH)
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
@OptimisticLock(excluded = true) @OptimisticLock(excluded = true)