markap14 commented on a change in pull request #4913:
URL: https://github.com/apache/nifi/pull/4913#discussion_r596951761



##########
File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java
##########
@@ -1090,6 +1090,16 @@ public int getActiveThreadCount() {
                     break;
                 }
             }
+
+            // Ensure that execution node will not be misused
+            if (getExecutionNode() == ExecutionNode.PRIMARY) {
+                if (getInputRequirement() == Requirement.INPUT_REQUIRED
+                        || getInputRequirement() == Requirement.INPUT_ALLOWED 
&& !getIncomingConnections().isEmpty()) {
+                    results.add(new ValidationResult.Builder()
+                            .explanation("Processor should set to run on all 
nodes.")

Review comment:
       Probably need to provide more details in the explanation. Why should the 
processor be set to run on all nodes? Perhaps something to the effect of 
"Processors with incoming connections cannot be scheduled for Primary Node 
Only."

##########
File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java
##########
@@ -1090,6 +1090,16 @@ public int getActiveThreadCount() {
                     break;
                 }
             }
+
+            // Ensure that execution node will not be misused
+            if (getExecutionNode() == ExecutionNode.PRIMARY) {
+                if (getInputRequirement() == Requirement.INPUT_REQUIRED
+                        || getInputRequirement() == Requirement.INPUT_ALLOWED 
&& !getIncomingConnections().isEmpty()) {

Review comment:
       I think this can be simplified to just: `if (getExecutionNode() == 
ExecutionNode.PRIMARY && hasIncomingConnection()) {`




-- 
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:
us...@infra.apache.org


Reply via email to