[
https://issues.apache.org/jira/browse/NIFI-1168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15011877#comment-15011877
]
Aldrin Piri commented on NIFI-1168:
-----------------------------------
Patch was a little wonky in application but was able to make it to work.
(nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/mock/MockProcessContext.java
wouldn't apply cleanly and I had to manually apply the rejected hunk)
There was one contrib error:
{code}
[WARNING]
src/main/java/org/apache/nifi/controller/scheduling/ConnectableProcessContext.java[23:8]
(imports) UnusedImports: Unused import - java.util.List.
{code}
Removed that and everything built appropriately.
Test was great for all the various scenarios and bases are covered. Performed
some adjustments using the method added to ProcessContext and this greatly aids
in the process of handling this emerging class of processors that are both
source and input-driven.
+1 and will merge from my verification environment.
> @TriggerWhenEmpty docs and developer guide incompatible onTrigger definitions
> -----------------------------------------------------------------------------
>
> Key: NIFI-1168
> URL: https://issues.apache.org/jira/browse/NIFI-1168
> Project: Apache NiFi
> Issue Type: Bug
> Components: Core Framework, Documentation & Website
> Affects Versions: 0.3.0
> Reporter: Aldrin Piri
> Assignee: Mark Payne
> Fix For: 0.4.0
>
> Attachments:
> 0001-NIFI-1168-Ensure-that-processors-with-only-looping-c.patch
>
>
> The TriggerWhenEmpty javadoc has the following specification for when a
> processor is executed:
> {code}
> /**
> * Marker annotation a {@link org.apache.nifi.processor.Processor Processor}
> * implementation can use to indicate that the Processor should still be
> * triggered even when it has no data in its work queue. By default,
> Processors
> * which have no non-self incoming edges will be triggered even if there is no
> * work in its queue. However, Processors that have non-self incoming edges
> will
> * only be triggered if they have work in their queue or they present this
> * annotation.
> *
> */
> {code}
> The developer guide, however specifies that:
> {quote}
> A Processor’s onTrigger method will be called only when it is scheduled to
> run and when work exists for the Processor. Work is said to exist for a
> Processor if any of the following conditions is met:
> A Connection whose destination is the Processor has at least
> one FlowFile in its queue
> The Processors has no incoming Connections
> The Processor is annotated with the @TriggerWhenEmpty annotation
> {quote}
> The key difference is that TriggerWhenEmpty specifies that if a processor
> only has self-directed incoming edges/loops, it will still be triggered by
> the framework, while the Developer Guide seems to not make such provisions.
> The behavior outlined in the developer guide is currently what is seen and
> this was stumbled upon while reviewing the patches associated with NIFI-1086
> and introduces a unique case in terms of functionality. Given that an
> InvokeHTTP processor can be run with or without inputs, there are certain
> relationships that would never happen (like the retry or failure) when the
> processor is driven only by a trigger event. In this case, loops that were
> instinctually created while making a sample flow to retry requests prevented
> the processor from executing.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)