mirror of
https://github.com/apache/nifi.git
synced 2025-02-16 23:15:36 +00:00
NIFI-1203: Do not count looping connections when determining validity based on incoming connections
Signed-off-by: joewitt <joewitt@apache.org>
This commit is contained in:
parent
0435911186
commit
a29b7b3bf0
@ -964,6 +964,18 @@ public class StandardProcessorNode extends ProcessorNode implements Connectable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<Connection> getIncomingNonLoopConnections() {
|
||||||
|
final List<Connection> connections = getIncomingConnections();
|
||||||
|
final List<Connection> nonLoopConnections = new ArrayList<>(connections.size());
|
||||||
|
for (final Connection connection : connections) {
|
||||||
|
if (!connection.getSource().equals(this)) {
|
||||||
|
nonLoopConnections.add(connection);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nonLoopConnections;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isValid() {
|
public boolean isValid() {
|
||||||
readLock.lock();
|
readLock.lock();
|
||||||
@ -991,13 +1003,13 @@ public class StandardProcessorNode extends ProcessorNode implements Connectable
|
|||||||
case INPUT_ALLOWED:
|
case INPUT_ALLOWED:
|
||||||
break;
|
break;
|
||||||
case INPUT_FORBIDDEN: {
|
case INPUT_FORBIDDEN: {
|
||||||
if (!getIncomingConnections().isEmpty()) {
|
if (!getIncomingNonLoopConnections().isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case INPUT_REQUIRED: {
|
case INPUT_REQUIRED: {
|
||||||
if (getIncomingConnections().isEmpty()) {
|
if (getIncomingNonLoopConnections().isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1045,7 +1057,7 @@ public class StandardProcessorNode extends ProcessorNode implements Connectable
|
|||||||
case INPUT_ALLOWED:
|
case INPUT_ALLOWED:
|
||||||
break;
|
break;
|
||||||
case INPUT_FORBIDDEN: {
|
case INPUT_FORBIDDEN: {
|
||||||
final int incomingConnCount = getIncomingConnections().size();
|
final int incomingConnCount = getIncomingNonLoopConnections().size();
|
||||||
if (incomingConnCount != 0) {
|
if (incomingConnCount != 0) {
|
||||||
results.add(new ValidationResult.Builder()
|
results.add(new ValidationResult.Builder()
|
||||||
.explanation("Processor does not allow upstream connections but currently has " + incomingConnCount)
|
.explanation("Processor does not allow upstream connections but currently has " + incomingConnCount)
|
||||||
@ -1056,7 +1068,7 @@ public class StandardProcessorNode extends ProcessorNode implements Connectable
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case INPUT_REQUIRED: {
|
case INPUT_REQUIRED: {
|
||||||
if (getIncomingConnections().isEmpty()) {
|
if (getIncomingNonLoopConnections().isEmpty()) {
|
||||||
results.add(new ValidationResult.Builder()
|
results.add(new ValidationResult.Builder()
|
||||||
.explanation("Processor requires an upstream connection but currently has none")
|
.explanation("Processor requires an upstream connection but currently has none")
|
||||||
.subject("Upstream Connections")
|
.subject("Upstream Connections")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user