turcsanyip commented on a change in pull request #4822:
URL: https://github.com/apache/nifi/pull/4822#discussion_r626765126
##########
File path:
nifi-api/src/main/java/org/apache/nifi/processor/AbstractProcessor.java
##########
@@ -21,7 +21,7 @@
public abstract class AbstractProcessor extends
AbstractSessionFactoryProcessor {
@Override
- public final void onTrigger(final ProcessContext context, final
ProcessSessionFactory sessionFactory) throws ProcessException {
+ public void onTrigger(final ProcessContext context, final
ProcessSessionFactory sessionFactory) throws ProcessException {
Review comment:
@ChrisSamo632 Thank you for the review changes and apologies for my late
reply!
Regarding this particular question of accessing `ProcessSessionFactory` in a
processor that comes from `AbstactProcessor` (indirectly):
Basically, we have the following options (as you already mentioned):
1. Remove the processor from the AWS abstract processors hierarchy and
extend `AbstractProcessSessionFactory` processor directly (actually, I would
not be against it because the code of the AWS abstract processors is quite
complicated/deprecated and the new `ConsumeKinesisStream` does not really need
the AWS client object provided by the abstract classes)
2. Inherit `AbstractAWSProcessor` from `AbstractSessionFactoryProcessor`,
copy this `onTrigger(ProcessContext, ProcessSessionFactory)` implementation
(without the `final` modifier) to the AWS base class and override the method
where custom handling of `ProcessSessionFactory` is needed (it would be code
duplication and I agree with you that it is not really nice)
3. Remove `final` modifier in `AbstractProcessor` (it looks OK to me but I'm
a bit uncertain about it because it would affect the base class of almost all
processors and I believe it was a design decision to make the
`AbstractProcessor`'s API as simple as possible)
@markap14 What is your opinion on option 3? Can the `final` be removed or it
should rather be untouched?
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]