ing-mattioni commented on code in PR #11245:
URL: https://github.com/apache/nifi/pull/11245#discussion_r3257731826
##########
nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/TailFile.java:
##########
@@ -415,6 +415,7 @@ public void recoverState(final ProcessContext context)
throws IOException {
private void initStates(final List<String> filesToTail, final Map<String,
String> statesMap, final boolean isCleared) {
int fileIndex = 0;
+ final Set<String> filesToTailSet = new HashSet<>(filesToTail);
Review Comment:
The Set is used to avoid repeated linear List.contains() checks while
reconciling restored state and removing files that are no longer tailed. With
many matching files, keeping this as a List would make startup/state
reconciliation trend toward O(n²). The original filesToTail list is still used
when adding new states, so ordering is preserved.
--
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]