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_r387735460
##########
File path:
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/LookupRecord.java
##########
@@ -263,6 +288,70 @@ public void onPropertyModified(final PropertyDescriptor
descriptor, final String
protected Set<Relationship> route(final Record record, final RecordSchema
writeSchema, final FlowFile flowFile, final ProcessContext context,
final Tuple<Map<String, RecordPath>, RecordPath> flowFileContext) {
+ final boolean isInPlaceReplacement =
context.getProperty(IN_PLACE_REPLACEMENT).asBoolean();
+
+ if(isInPlaceReplacement) {
+ return doInPlaceReplacement(record, writeSchema, flowFile,
context, flowFileContext);
+ } else {
+ return doResultPathReplacement(record, writeSchema, flowFile,
context, flowFileContext);
+ }
+
+ }
+
+ private Set<Relationship> doInPlaceReplacement(Record record, RecordSchema
writeSchema, FlowFile flowFile,
Review comment:
`writeSchema` is not used. Should remove it.
----------------------------------------------------------------
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