Skip to content

Commit 46f4036

Browse files
committed
Merge remote-tracking branch 'origin/MET-6417-out-of-memory-issues-cause-by-metis-validator-service-in-flink-po-c' into develop
2 parents 55b063f + 1b2e597 commit 46f4036

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

validation/src/main/java/eu/europeana/processing/validation/processor/ValidationOperator.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,20 @@ private String reorderFileContent(ExecutionRecordResult executionRecordResult) t
110110
}
111111

112112
private void validateFile(ExecutionRecordResult executionRecordResult, String sortedDocument) {
113-
ValidationResult result =
114-
validationService.singleValidation(
115-
schema,
116-
rootFileLocation,
117-
schematronFileLocation,
118-
sortedDocument
119-
);
113+
ValidationResult result;
114+
ClassLoader original = Thread.currentThread().getContextClassLoader();
115+
try {
116+
Thread.currentThread().setContextClassLoader(ValidationExecutionService.class.getClassLoader());
117+
result =
118+
validationService.singleValidation(
119+
schema,
120+
rootFileLocation,
121+
schematronFileLocation,
122+
sortedDocument
123+
);
124+
} finally {
125+
Thread.currentThread().setContextClassLoader(original);
126+
}
120127
if (result.isSuccess()) {
121128
LOGGER.debug("Validation Success for datasetId {}, recordId {}", executionRecordResult.getExecutionRecord().getExecutionRecordKey().getDatasetId(),
122129
executionRecordResult.getRecordId());

0 commit comments

Comments
 (0)