use of com.thinkbiganalytics.metadata.rest.model.nifi.NifiFlowCacheBaseProcessorDTO in project kylo by Teradata.
the class NiFiTemplateCacheProcessorGraph method getProcessorDestinations.
/**
* recursively add and connect processors
* @param processorId
* @param connectionSourceToDestination
* @return
*/
private List<NifiFlowCacheBaseProcessorDTO> getProcessorDestinations(String processorId, Map<String, List<String>> connectionSourceToDestination, Map<String, NifiFlowCacheBaseProcessorDTO> processedDestinations) {
if (processedDestinations == null) {
processedDestinations = new HashMap<>();
}
List<NifiFlowCacheBaseProcessorDTO> destinations = new ArrayList<>();
List<String> destIds = connectionSourceToDestination.get(processorId);
if (destIds != null) {
for (String id : destIds) {
if (processedDestinations.containsKey(id)) {
destinations.add(processedDestinations.get(id));
} else if (id != processorId) {
String processorName = processorIdToProcessorName.get(id);
if (StringUtils.isNotBlank(processorName)) {
NifiFlowCacheBaseProcessorDTO dto = new NifiFlowCacheBaseProcessorDTO();
dto.setId(id);
dto.setName(processorName);
destinations.add(dto);
processedDestinations.put(id, dto);
List<NifiFlowCacheBaseProcessorDTO> destProcessors = getProcessorDestinations(id, connectionSourceToDestination, processedDestinations);
destinations.addAll(destProcessors);
}
} else {
log.info("skipping processor relation {}", id);
}
}
}
return destinations;
}
use of com.thinkbiganalytics.metadata.rest.model.nifi.NifiFlowCacheBaseProcessorDTO in project kylo by Teradata.
the class NifiFlowCacheImpl method getProcessorDestinations.
/**
* recursively add and connect processors
*/
private List<NifiFlowCacheBaseProcessorDTO> getProcessorDestinations(String processorId, Map<String, List<String>> connectionSourceToDestination, Map<String, NifiFlowCacheBaseProcessorDTO> processedDestinations) {
if (processedDestinations == null) {
processedDestinations = new HashMap<>();
}
List<NifiFlowCacheBaseProcessorDTO> destinations = new ArrayList<>();
List<String> destIds = connectionSourceToDestination.get(processorId);
if (destIds != null) {
for (String id : destIds) {
if (processedDestinations.containsKey(id)) {
destinations.add(processedDestinations.get(id));
} else if (id != processorId) {
String processorName = processorIdToProcessorName.get(id);
if (StringUtils.isNotBlank(processorName)) {
NifiFlowCacheBaseProcessorDTO dto = new NifiFlowCacheBaseProcessorDTO();
dto.setId(id);
dto.setName(processorName);
destinations.add(dto);
processedDestinations.put(id, dto);
List<NifiFlowCacheBaseProcessorDTO> destProcessors = getProcessorDestinations(id, connectionSourceToDestination, processedDestinations);
destinations.addAll(destProcessors);
}
} else {
log.info("skipping processor relation {}", id);
}
}
}
return destinations;
}
Aggregations