[
https://issues.apache.org/jira/browse/NIFI-5152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16466195#comment-16466195
]
ASF GitHub Bot commented on NIFI-5152:
--------------------------------------
Github user zenfenan commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2681#discussion_r186485684
--- 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 --
Thanks for pointing it out. I understand now.
> 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)