markap14 commented on code in PR #10993:
URL: https://github.com/apache/nifi/pull/10993#discussion_r2982594630


##########
nifi-commons/nifi-write-ahead-log/src/main/java/org/apache/nifi/wali/HashMapSnapshot.java:
##########
@@ -175,14 +175,18 @@ public void update(final Collection<T> records) {
 
             switch (updateType) {
                 case DELETE:
-                    recordMap.remove(recordId);
+                    if (recordId != null) {

Review Comment:
   There are actually 2 changes here, really: The null-checks here in the 
DELETE/SWAP_OUT/etc. cases; and the SWAP_FILE_DELETED/SWAP_FILE_RENAMED 
branches added.
   
   The null-checks are actually not needed. I will revert that. The only 
records that should come in here with null IDs are the SWAP_FILE_DELETE, 
SWAP-FILE_RENAMED types. Those actually are necessary for this PR. The reason 
they are introduced here is that this introduces the new capability of removing 
FlowFiles from the flow selectively, and this could mean removing some but not 
all FlowFiles from a Swap File OR removing all FlowFiles in a Swap File. This 
was previously never done (swap files were swapped in entirely, even when a 
queue was drained).



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