dariuszseweryn commented on PR #9737: URL: https://github.com/apache/nifi/pull/9737#issuecomment-2675136958
> For example, should the Scheduler thread be created in the onScheduled method, but only started in onTrigger? This is possible but has a downside. Scheduler needs a record processor which uses a `ProcessSessionFactory` that is available only in `onTrigger()`. The processor won't get called before the thread the Scheduler runs on is started, yet it would introduce additional state in the record processor which is definitely a downside. The question is: is the advantage bigger than the disadvantage? imho not given the creation is fairly infrequent > It may also be more efficient to use an atomic variable, as opposed to the synchronized lock object approach. I may lack experience with NiFi but it seems to me that start and stop events are fairly infrequent for processors — this indicates there will be little contention especially when the lock is inherent to a processor instance, no? If so, having an AtomicBoolean or other Atomic* will only unnecessary complicate the code. -- 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]
