markap14 commented on a change in pull request #4088: NIFI-7197 - In-place
replacement in LookupRecord processor
URL: https://github.com/apache/nifi/pull/4088#discussion_r387732307
##########
File path:
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/LookupRecord.java
##########
@@ -214,24 +227,36 @@ protected PropertyDescriptor
getSupportedDynamicPropertyDescriptor(final String
}
final Set<String> requiredKeys =
validationContext.getProperty(LOOKUP_SERVICE).asControllerService(LookupService.class).getRequiredKeys();
- final Set<String> missingKeys = requiredKeys.stream()
- .filter(key -> !dynamicPropNames.contains(key))
- .collect(Collectors.toSet());
- if (!missingKeys.isEmpty()) {
- final List<ValidationResult> validationResults = new ArrayList<>();
- for (final String missingKey : missingKeys) {
- final ValidationResult result = new ValidationResult.Builder()
- .subject(missingKey)
- .valid(false)
- .explanation("The configured Lookup Services requires that
a key be provided with the name '" + missingKey
- + "'. Please add a new property to this Processor with
a name '" + missingKey
- + "' and provide a RecordPath that can be used to
retrieve the appropriate value.")
- .build();
- validationResults.add(result);
+ if(validationContext.getProperty(IN_PLACE_REPLACEMENT).asBoolean()) {
+ // it must be a single key lookup service
+ if(requiredKeys.size() != 1) {
+ return Collections.singleton(new ValidationResult.Builder()
+ .subject(LOOKUP_SERVICE.getDisplayName())
+ .valid(false)
+ .explanation("The configured Lookup Services should
only require one key when in-place replacement is set to true.")
Review comment:
I think this is a typo. Should read "The configured Lookup Service" (i.e.,
Service should not be plural).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services