ben-manes commented on code in PR #6364:
URL: https://github.com/apache/nifi/pull/6364#discussion_r983930495


##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/LookupRecord.java:
##########
@@ -548,8 +577,15 @@ public Set<Relationship> lookup(final Record record, final 
ProcessContext contex
 
             final FlowFile flowFile = lookupContext.getOriginalFlowFile();
             final Optional<?> lookupValueOption;
+            final Optional<?> lookupValueCacheOption;
+
             try {
-                lookupValueOption = lookupService.lookup(lookupCoordinates, 
flowFile.getAttributes());
+                lookupValueCacheOption = (Optional<?>) 
cache.get(lookupCoordinates, k -> null);

Review Comment:
   fyi, you can use `cache.getIfPresent(key)` to lookup or return null. Of 
course if possible it is preferred to compute within the cache to avoid a cache 
stampede.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to