RED-8670: integrate table inference from research
* introduce controllerAdvice to ControllerV2 package * remove unnecessary analysis requirement calculation for deleted files * silence javadoc lint warnings (e.g. no comment)
This commit is contained in:
parent
454a4d7acc
commit
d93bdf1330
@ -67,8 +67,11 @@ java {
|
||||
allprojects {
|
||||
|
||||
tasks.withType<Javadoc> {
|
||||
logging.captureStandardOutput(LogLevel.ERROR)
|
||||
logging.captureStandardError(LogLevel.ERROR)
|
||||
options {
|
||||
this as StandardJavadocDocletOptions
|
||||
addBooleanOption("Xdoclint:none", true)
|
||||
addStringOption("Xmaxwarns", "1")
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
|
||||
@ -199,7 +199,7 @@ public class FileEntity {
|
||||
@Column
|
||||
private OffsetDateTime errorTimestamp;
|
||||
|
||||
@ElementCollection(fetch = FetchType.EAGER)
|
||||
@ElementCollection
|
||||
private List<FileEntityComponentMappingVersionEntity> componentMappingVersions;
|
||||
|
||||
|
||||
|
||||
@ -66,6 +66,7 @@ public class FileStatusMapper {
|
||||
.lastIndexed(status.getLastIndexed())
|
||||
.fileSize(status.getFileSize())
|
||||
.fileErrorInfo(status.getFileErrorInfo())
|
||||
.componentMappingVersions(status.getComponentMappingVersions())
|
||||
.build();
|
||||
|
||||
}
|
||||
|
||||
@ -86,8 +86,12 @@ public class ReanalysisRequiredStatusService {
|
||||
fileStatus.setDossierTemplateId(dossier.getDossierTemplateId());
|
||||
fileStatus.setDossierStatusId(dossier.getDossierStatusId());
|
||||
|
||||
if (fileStatus.isSoftOrHardDeleted()) {
|
||||
log.debug("File {} is deleted, thus analysis is not required", fileStatus.getId());
|
||||
return new AnalysisRequiredResult(false, false);
|
||||
}
|
||||
if (dossier.getSoftDeletedTime() != null || dossier.getHardDeletedTime() != null || dossier.getArchivedTime() != null) {
|
||||
log.info("Dossier {} is deleted, thus analysis is not required", fileStatus.getDossierId());
|
||||
log.debug("Dossier {} is deleted, thus analysis is not required", fileStatus.getDossierId());
|
||||
return new AnalysisRequiredResult(false, false);
|
||||
}
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ package com.iqser.red.service.persistence.management.v1.processor.service.job;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@ -82,17 +83,17 @@ public class AutomaticAnalysisJob implements Job {
|
||||
var consumerCount = redactionQueueInfo.getConsumerCount();
|
||||
if (redactionQueueInfo.getMessageCount() <= consumerCount * 5) {
|
||||
// queue up 5 files
|
||||
var allStatuses = getAllRelevantStatuses();
|
||||
List<FileModel> allStatuses = getAllRelevantStatuses();
|
||||
|
||||
allStatuses.sort(Comparator.comparing(FileModel::getLastUpdated));
|
||||
|
||||
var allStatusesIterator = allStatuses.iterator();
|
||||
Iterator<FileModel> allStatusesIterator = allStatuses.iterator();
|
||||
log.debug("[Tenant:{}] Files that require reanalysis: {}", TenantContext.getTenantId(), allStatuses.size());
|
||||
|
||||
var queuedFiles = 0;
|
||||
int queuedFiles = 0;
|
||||
|
||||
while (queuedFiles < (consumerCount * 5) && allStatusesIterator.hasNext()) {
|
||||
var next = allStatusesIterator.next();
|
||||
FileModel next = allStatusesIterator.next();
|
||||
// in case the file doesn't have numberOfPages set, we assume an average.
|
||||
|
||||
reanalyseFile(next);
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.iqser.red.service.persistence.service.v1.api.shared.model;
|
||||
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.FileErrorInfo;
|
||||
@ -147,7 +148,8 @@ public class FileStatus {
|
||||
private OffsetDateTime lastIndexed;
|
||||
@Schema(description = "The error information for the error state of the file")
|
||||
private FileErrorInfo fileErrorInfo;
|
||||
|
||||
@Schema(description = "Shows which versions of each mapping the last analysis has been performed")
|
||||
private Map<String, Integer> componentMappingVersions;
|
||||
|
||||
@Schema(description = "Shows if this file has been OCRed by us. Last Time of OCR.")
|
||||
public OffsetDateTime getLastOCRTime() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user