/** * Extracts configured settings from the specified connection only if they have also been specified in the connectionDTO. * * @param connection connection * @param connectionDTO dto * @return properties */ private Map<String, String> extractConfiguredPropertyValues(Connection connection, ConnectionDTO connectionDTO) { Map<String, String> values = new HashMap<>(); if (connectionDTO.getName() != null) { values.put(NAME, connection.getName()); } if (connectionDTO.getFlowFileExpiration() != null) { values.put(FLOW_FILE_EXPIRATION, String.valueOf(connection.getFlowFileQueue().getFlowFileExpiration())); } if (connectionDTO.getBackPressureObjectThreshold() != null) { values.put(BACK_PRESSURE_OBJECT_THRESHOLD, String.valueOf(connection.getFlowFileQueue().getBackPressureObjectThreshold())); } if (connectionDTO.getBackPressureDataSizeThreshold() != null) { values.put(BACK_PRESSURE_DATA_SIZE_THRESHOLD, String.valueOf(connection.getFlowFileQueue().getBackPressureDataSizeThreshold())); } if (connectionDTO.getPrioritizers() != null) { List<String> prioritizers = new ArrayList<>(); for (FlowFilePrioritizer prioritizer : connection.getFlowFileQueue().getPriorities()) { prioritizers.add(prioritizer.getClass().getCanonicalName()); } values.put(PRIORITIZERS, StringUtils.join(prioritizers, ", ")); } return values; }
public VersionedConnection mapConnection(final Connection connection) { final FlowFileQueue queue = connection.getFlowFileQueue(); final VersionedConnection versionedConnection = new InstantiatedVersionedConnection(connection.getIdentifier(), connection.getProcessGroup().getIdentifier()); versionedConnection.setIdentifier(getId(connection.getVersionedComponentId(), connection.getIdentifier())); versionedConnection.setGroupIdentifier(getGroupId(connection.getProcessGroup().getIdentifier())); versionedConnection.setName(connection.getName()); versionedConnection.setBackPressureDataSizeThreshold(queue.getBackPressureDataSizeThreshold()); versionedConnection.setBackPressureObjectThreshold(queue.getBackPressureObjectThreshold()); versionedConnection.setFlowFileExpiration(queue.getFlowFileExpiration()); versionedConnection.setLabelIndex(connection.getLabelIndex()); versionedConnection.setPrioritizers(queue.getPriorities().stream().map(p -> p.getClass().getName()).collect(Collectors.toList())); versionedConnection.setSelectedRelationships(connection.getRelationships().stream().map(Relationship::getName).collect(Collectors.toSet())); versionedConnection.setzIndex(connection.getZIndex()); final FlowFileQueue flowFileQueue = connection.getFlowFileQueue(); versionedConnection.setLoadBalanceStrategy(flowFileQueue.getLoadBalanceStrategy().name()); versionedConnection.setPartitioningAttribute(flowFileQueue.getPartitioningAttribute()); versionedConnection.setLoadBalanceCompression(flowFileQueue.getLoadBalanceCompression().name()); versionedConnection.setBends(connection.getBendPoints().stream() .map(this::mapPosition) .collect(Collectors.toList())); versionedConnection.setSource(mapConnectable(connection.getSource())); versionedConnection.setDestination(mapConnectable(connection.getDestination())); return versionedConnection; }
final String backPressureDataSize = connection.getFlowFileQueue().getBackPressureDataSizeThreshold(); final Double backPressureBytes = DataUnit.parseDataSize(backPressureDataSize, DataUnit.B); if (backPressureBytes > 0) {
dto.setBackPressureDataSizeThreshold(flowFileQueue.getBackPressureDataSizeThreshold()); dto.setFlowFileExpiration(flowFileQueue.getFlowFileExpiration()); dto.setPrioritizers(new ArrayList<String>());
addTextElement(element, "maxWorkQueueDataSize", connection.getFlowFileQueue().getBackPressureDataSizeThreshold());
connStatus.setDestinationId(conn.getDestination().getIdentifier()); connStatus.setDestinationName(isDestinationAuthorized ? conn.getDestination().getName() : conn.getDestination().getIdentifier()); connStatus.setBackPressureDataSizeThreshold(conn.getFlowFileQueue().getBackPressureDataSizeThreshold()); connStatus.setBackPressureObjectThreshold(conn.getFlowFileQueue().getBackPressureObjectThreshold());