NIFI-14283 ConsumeKinesisStream non-static workerLock#9737
NIFI-14283 ConsumeKinesisStream non-static workerLock#9737exceptionfactory merged 1 commit intoapache:mainfrom
Conversation
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks for looking at improving this behavior @dariuszseweryn.
Although moving from a static object to an instance variable is a step forward, it seems like this is worth some additional evaluation. For example, should the Scheduler thread be created in the onScheduled method, but only started in onTrigger? It may also be more efficient to use an atomic variable, as opposed to the synchronized lock object approach.
This is possible but has a downside. Scheduler needs a record processor which uses a The question is: is the advantage bigger than the disadvantage?
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. |
|
Thanks for the reply!
Good point regarding the
Starting and stopping is less frequent, but the framework calls |
Given the Scheduler produces records at arbitrary moments we can:
The problem here is that the processor is an adapter between two opinionated frameworks. The adapter can be made at the expense of complexity. This begs a question – besides ugliness – what are the downsides of holding to the Session Factory?
The synchronization is only used if there is no |
|
@exceptionfactory I have broken out the Session Factory issue into a separate JIRA: NIFI-14292 |
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks for discussing the options @dariuszseweryn. Tracking the more substantive changes in a separate Jira issue sounds good. As this pull request is a useful incremental adjustment, I will proceed to merge and we can consider the larger questions under the new Jira issue you created.
Summary
NIFI-14283
Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000Pull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
mvn clean install -P contrib-checkLicensing
LICENSEandNOTICEfilesDocumentation