@Override public Set<Relationship> getAvailableRelationships() { for (final Connection connection : connectable.getConnections()) { if (connection.getFlowFileQueue().isFull()) { return Collections.emptySet(); } } final Collection<Relationship> relationships = connectable.getRelationships(); if (relationships instanceof Set) { return (Set<Relationship>) relationships; } return new HashSet<>(connectable.getRelationships()); }
public Set<Relationship> getAvailableRelationships() { final Set<Relationship> set = new HashSet<>(); for (final Relationship relationship : getConnectable().getRelationships()) { final Collection<Connection> connections = getConnections(relationship); if (connections.isEmpty()) { set.add(relationship); } else { boolean available = true; for (final Connection connection : connections) { if (connection.getFlowFileQueue().isFull()) { available = false; } } if (available) { set.add(relationship); } } } return set; } }
@Override public Set<Relationship> getAvailableRelationships() { verifyTaskActive(); final Set<Relationship> set = new HashSet<>(); for (final Relationship relationship : procNode.getRelationships()) { final Collection<Connection> connections = procNode.getConnections(relationship); if (connections.isEmpty()) { set.add(relationship); } else { boolean available = true; for (final Connection connection : connections) { if (connection.getFlowFileQueue().isFull()) { available = false; } } if (available) { set.add(relationship); } } } return set; }
public static boolean anyRelationshipAvailable(final Connectable connectable) { for (final Relationship relationship : connectable.getRelationships()) { final Collection<Connection> connections = connectable.getConnections(relationship); boolean available = true; for (final Connection connection : connections) { if (connection.getFlowFileQueue().isFull()) { available = false; break; } } if (available) { return true; } } return false; }
public boolean isAnyRelationshipAvailable() { for (final Relationship relationship : getConnectable().getRelationships()) { final Collection<Connection> connections = getConnections(relationship); boolean available = true; for (final Connection connection : connections) { if (connection.getFlowFileQueue().isFull()) { available = false; break; } } if (available) { return true; } } return false; }
/** * @return true if we are allowed to take FlowFiles only from self-loops. This is the case when no Relationships are available except for self-looping Connections */ private boolean pollFromSelfLoopsOnly() { if (isTriggerWhenAnyDestinationAvailable()) { // we can pull from any incoming connection, as long as at least one downstream connection // is available for each relationship. // I.e., we can poll only from self if no relationships are available return !Connectables.anyRelationshipAvailable(connectable); } else { for (final Connection connection : connectable.getConnections()) { // A downstream connection is full. We are only allowed to pull from self-loops. if (connection.getFlowFileQueue().isFull()) { return true; } } } return false; }
if (connection.getFlowFileQueue().isFull()) { available = false; break;
public int getAvailableRelationshipCount() { int count = 0; for (final Relationship relationship : connectable.getRelationships()) { final Collection<Connection> connections = connectable.getConnections(relationship); if (connections == null || connections.isEmpty()) { count++; } else { boolean available = true; for (final Connection connection : connections) { // consider self-loops available if (connection.getSource() == connection.getDestination()) { continue; } if (connection.getFlowFileQueue().isFull()) { available = false; break; } } if (available) { count++; } } } return count; }
private int getAvailableRelationshipCount(final Connectable connectable) { int count = 0; for (final Relationship relationship : connectable.getRelationships()) { final Collection<Connection> connections = connectable.getConnections(relationship); if (connections == null || connections.isEmpty()) { if (connectable.isAutoTerminated(relationship)) { // If the relationship is auto-terminated, consider it available. count++; } } else { boolean available = true; for (final Connection connection : connections) { if (connection.getSource() == connection.getDestination()) { // don't count self-loops continue; } if (connection.getFlowFileQueue().isFull()) { available = false; } } if (available) { count++; } } } return count; } }
if (connection.getFlowFileQueue().isFull()) { logger.debug("Responding with ResponseCode PORTS_DESTINATION_FULL for {}", port); throw new HandshakeException(ResponseCode.PORTS_DESTINATION_FULL, "Received port identifier " + portId + ", but its destination is full");
if (connection.getFlowFileQueue().isFull()) { logger.debug("Responding with ResponseCode PORTS_DESTINATION_FULL for {}", port); throw new HandshakeException(ResponseCode.PORTS_DESTINATION_FULL, "Received port identifier " + portId + ", but its destination is full");