[
https://issues.apache.org/jira/browse/NIFI-5152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16466120#comment-16466120
]
ASF GitHub Bot commented on NIFI-5152:
--------------------------------------
Github user bbende commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2681#discussion_r186478219
--- Diff:
nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/MoveHDFS.java
---
@@ -228,14 +232,17 @@ public void onScheduled(ProcessContext context)
throws Exception {
@Override
public void onTrigger(ProcessContext context, ProcessSession session)
throws ProcessException {
- // MoveHDFS
- FlowFile parentFlowFile = session.get();
- if (parentFlowFile == null) {
+ FlowFile flowFile = session.get();
+
+ if (flowFile == null && context.hasIncomingConnection()) {
+ context.yield();
--- End diff --
I know this is a minor point, but we don't need to yield here. Unless a
processor has @TriggerWhenEmpty then it won't be scheduled unless there are
flow files in the queue so we don't have to work about repeatedly executing and
getting null. The case we can get null is when concurrent tasks is > 1 and one
tasks grabs the flow file and the other gets null.
> MoveHDFS should have @InputRequirement(Requirement.INPUT_REQUIRED)
> ------------------------------------------------------------------
>
> Key: NIFI-5152
> URL: https://issues.apache.org/jira/browse/NIFI-5152
> Project: Apache NiFi
> Issue Type: Bug
> Affects Versions: 1.6.0
> Reporter: Bryan Bende
> Assignee: Sivaprasanna Sethuraman
> Priority: Minor
> Attachments:
> 0001-NIFI-5152-MoveHDFS-now-works-even-with-no-upstream-c.patch
>
>
> The onTrigger method of MoveHDFS will return when no incoming flow file is
> obtained, therefore the processor can only be used with an incoming
> relationships and should have the INPUT_REQUIRED annotation.
> If the expected behavior was to use the processor without an incoming
> relationship, then instead of requiring input, the code needs to be updated
> to handle both scenarios.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)