NIFI-8300 Make non-source processors invalid if scheduled for Primary Node only

This closes #4913.

Signed-off-by: Mark Payne <markap14@hotmail.com>
This commit is contained in:
s9514171 2021-03-18 06:47:35 +00:00 committed by Mark Payne
parent 446401b6f1
commit fedeafb43f
1 changed files with 7 additions and 0 deletions

View File

@ -1090,6 +1090,13 @@ public class StandardProcessorNode extends ProcessorNode implements Connectable
break;
}
}
// Ensure that execution node will not be misused
if (getExecutionNode() == ExecutionNode.PRIMARY && hasIncomingConnection()) {
results.add(new ValidationResult.Builder()
.explanation("Processors with incoming connections cannot be scheduled for Primary Node Only.")
.subject("Execution Node").valid(false).build());
}
} catch (final Throwable t) {
LOG.error("Failed to perform validation", t);
results.add(new ValidationResult.Builder().explanation("Failed to run validation due to " + t.toString())