diff --git a/src/main/java/edu/kit/datamanager/pit/pitservice/impl/EmbeddedStrictValidatorStrategy.java b/src/main/java/edu/kit/datamanager/pit/pitservice/impl/EmbeddedStrictValidatorStrategy.java index d08224c5..afc65d97 100644 --- a/src/main/java/edu/kit/datamanager/pit/pitservice/impl/EmbeddedStrictValidatorStrategy.java +++ b/src/main/java/edu/kit/datamanager/pit/pitservice/impl/EmbeddedStrictValidatorStrategy.java @@ -29,6 +29,7 @@ public class EmbeddedStrictValidatorStrategy implements IValidationStrategy { private static final Logger LOG = LoggerFactory.getLogger(EmbeddedStrictValidatorStrategy.class); + protected static final Executor EXECUTOR = Executors.newWorkStealingPool(); @Autowired public AsyncLoadingCache typeLoader; @@ -65,7 +66,7 @@ public void validate(PIDRecord pidRecord) throws RecordValidationException, Exte String.format("No type found for identifier %s.", profilePID)); } this.strictProfileValidation(pidRecord, profileDefinition); - }); + }, EXECUTOR); } catch (RuntimeException e) { LOG.error("Could not resolve identifier {}.", profilePID); throw new ExternalServiceException( diff --git a/src/main/java/edu/kit/datamanager/pit/typeregistry/impl/TypeRegistry.java b/src/main/java/edu/kit/datamanager/pit/typeregistry/impl/TypeRegistry.java index f43530da..c964a80b 100644 --- a/src/main/java/edu/kit/datamanager/pit/typeregistry/impl/TypeRegistry.java +++ b/src/main/java/edu/kit/datamanager/pit/typeregistry/impl/TypeRegistry.java @@ -40,6 +40,7 @@ public class TypeRegistry implements ITypeRegistry { private static final Logger LOG = LoggerFactory.getLogger(TypeRegistry.class); + protected static final Executor EXECUTOR = Executors.newWorkStealingPool(35); @Autowired public AsyncLoadingCache typeCache; @@ -108,7 +109,7 @@ private TypeDefinition constructTypeDefinition(JsonNode registryRepresentation) final String repeatable = semantics.path("repeatable").asText("No"); typeDefinition.setRepeatable(!"No".equalsIgnoreCase(repeatable)); properties.put(name, typeDefinition); - }); + }, EXECUTOR); }) .collect(Collectors.toList());