You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "markap14 (via GitHub)" <gi...@apache.org> on 2026/01/05 21:58:31 UTC

[PR] NIFI-15427: Added drainFlowFiles(FlowContext) method to Connector [nifi-api]

markap14 opened a new pull request, #42:
URL: https://github.com/apache/nifi-api/pull/42

   <!-- SPDX-License-Identifier: Apache-2.0 -->
   
   # Summary
   
   [NIFI-00000](https://issues.apache.org/jira/browse/NIFI-00000)
   
   # Tracking
   
   Please complete the following tracking steps prior to pull request creation.
   
   ### Issue Tracking
   
   - [ ] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue created
   
   ### Pull Request Tracking
   
   - [ ] Pull Request title starts with Apache NiFi Jira issue number, such as `NIFI-00000`
   - [ ] Pull Request commit message starts with Apache NiFi Jira issue number, as such `NIFI-00000`
   
   ### Pull Request Formatting
   
   - [ ] Pull Request based on current revision of the `main` branch
   - [ ] Pull Request refers to a feature branch with one commit containing changes
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15427: Added drainFlowFiles(FlowContext) method to Connector [nifi-api]

Posted by "mcgilman (via GitHub)" <gi...@apache.org>.
mcgilman commented on code in PR #42:
URL: https://github.com/apache/nifi-api/pull/42#discussion_r2665632815


##########
src/main/java/org/apache/nifi/components/connector/Connector.java:
##########
@@ -195,4 +196,12 @@ public interface Connector {
     List<AllowableValue> fetchAllowableValues(String stepName, String propertyName, FlowContext flowContext);
 
     List<AllowableValue> fetchAllowableValues(String stepName, String propertyName, FlowContext flowContext, String filter);
+
+    /**
+     * Drains any in-flight FlowFiles from the flow associated with the given Flow Context by processing the existing data
+     * but not accepting any new data.
+     * @param flowContext the flow context
+     * @return a Future that will be completed when the draining is complete
+     */
+    CompletableFuture<Void> drainFlowFiles(FlowContext flowContext);

Review Comment:
   The other PR is now merged but this is still an issue:
   
   > PMD Failure: org.apache.nifi.components.connector.AbstractConnector:159 Rule:MissingOverride Priority:3 The method 'drainFlowFiles(FlowContext)' is missing an @Override annotation.



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15427: Added drainFlowFiles(FlowContext) method to Connector [nifi-api]

Posted by "mcgilman (via GitHub)" <gi...@apache.org>.
mcgilman merged PR #42:
URL: https://github.com/apache/nifi-api/pull/42


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15427: Added drainFlowFiles(FlowContext) method to Connector [nifi-api]

Posted by "mcgilman (via GitHub)" <gi...@apache.org>.
mcgilman commented on PR #42:
URL: https://github.com/apache/nifi-api/pull/42#issuecomment-3715434200

   Reviewing...


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15427: Added drainFlowFiles(FlowContext) method to Connector [nifi-api]

Posted by "markap14 (via GitHub)" <gi...@apache.org>.
markap14 commented on code in PR #42:
URL: https://github.com/apache/nifi-api/pull/42#discussion_r2670218086


##########
src/main/java/org/apache/nifi/components/connector/Connector.java:
##########
@@ -195,4 +196,12 @@ public interface Connector {
     List<AllowableValue> fetchAllowableValues(String stepName, String propertyName, FlowContext flowContext);
 
     List<AllowableValue> fetchAllowableValues(String stepName, String propertyName, FlowContext flowContext, String filter);
+
+    /**
+     * Drains any in-flight FlowFiles from the flow associated with the given Flow Context by processing the existing data
+     * but not accepting any new data.
+     * @param flowContext the flow context
+     * @return a Future that will be completed when the draining is complete
+     */
+    CompletableFuture<Void> drainFlowFiles(FlowContext flowContext);

Review Comment:
   Thanks @mcgilman resolved.



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15427: Added drainFlowFiles(FlowContext) method to Connector [nifi-api]

Posted by "mcgilman (via GitHub)" <gi...@apache.org>.
mcgilman commented on code in PR #42:
URL: https://github.com/apache/nifi-api/pull/42#discussion_r2665574755


##########
src/main/java/org/apache/nifi/components/connector/Connector.java:
##########
@@ -195,4 +196,12 @@ public interface Connector {
     List<AllowableValue> fetchAllowableValues(String stepName, String propertyName, FlowContext flowContext);
 
     List<AllowableValue> fetchAllowableValues(String stepName, String propertyName, FlowContext flowContext, String filter);
+
+    /**
+     * Drains any in-flight FlowFiles from the flow associated with the given Flow Context by processing the existing data
+     * but not accepting any new data.
+     * @param flowContext the flow context
+     * @return a Future that will be completed when the draining is complete
+     */
+    CompletableFuture<Void> drainFlowFiles(FlowContext flowContext);

Review Comment:
   This changes causes an issue with `AbstractConnector`.
   
   > 'drainFlowFiles(FlowContext)' in 'org.apache.nifi.components.connector.AbstractConnector' clashes with 'drainFlowFiles(FlowContext)' in 'org.apache.nifi.components.connector.Connector'; attempting to assign weaker access privileges ('protected'); was 'public'



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-15427: Added drainFlowFiles(FlowContext) method to Connector [nifi-api]

Posted by "mcgilman (via GitHub)" <gi...@apache.org>.
mcgilman commented on code in PR #42:
URL: https://github.com/apache/nifi-api/pull/42#discussion_r2665580032


##########
src/main/java/org/apache/nifi/components/connector/Connector.java:
##########
@@ -195,4 +196,12 @@ public interface Connector {
     List<AllowableValue> fetchAllowableValues(String stepName, String propertyName, FlowContext flowContext);
 
     List<AllowableValue> fetchAllowableValues(String stepName, String propertyName, FlowContext flowContext, String filter);
+
+    /**
+     * Drains any in-flight FlowFiles from the flow associated with the given Flow Context by processing the existing data
+     * but not accepting any new data.
+     * @param flowContext the flow context
+     * @return a Future that will be completed when the draining is complete
+     */
+    CompletableFuture<Void> drainFlowFiles(FlowContext flowContext);

Review Comment:
   It looks like this was addressed in your other PR [1]. Let me review that one first.
   
   [1] https://github.com/apache/nifi-api/pull/43/files#diff-2e99d4db37604b309db7bf3068db05180e0c05418d334577fa911ceaac4393fdR159



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org