use of com.thinkbiganalytics.metadata.rest.model.nifi.NiFiFlowCacheConnectionData in project kylo by Teradata.
the class NifiFlowCacheImpl method connectionDTOtoConnectionIdMap.
private Map<String, NiFiFlowCacheConnectionData> connectionDTOtoConnectionIdMap(Collection<ConnectionDTO> connections) {
Map<String, NiFiFlowCacheConnectionData> connectionMap = new HashMap<>();
connections.stream().forEach(conn -> {
connectionMap.put(conn.getId(), new NiFiFlowCacheConnectionData(conn.getId(), conn.getName(), conn.getSource() != null ? conn.getSource().getId() : null, conn.getDestination() != null ? conn.getDestination().getId() : null));
});
return connectionMap;
}
use of com.thinkbiganalytics.metadata.rest.model.nifi.NiFiFlowCacheConnectionData in project kylo by Teradata.
the class NifiFlowCacheImpl method syncAndReturnUpdates.
private NiFiFlowCacheSync syncAndReturnUpdates(NiFiFlowCacheSync sync, boolean preview) {
if (!preview) {
lastSyncTimeMap.put(sync.getSyncId(), DateTime.now());
}
if (isKyloClustered()) {
applyClusterUpdates();
}
if (sync.needsUpdate(lastUpdated)) {
Map<String, String> processorIdToFeedNameMapCopy = ImmutableMap.copyOf(processorIdToFeedNameMap);
Map<String, String> processorIdToFeedProcessGroupIdCopy = ImmutableMap.copyOf(processorIdToFeedProcessGroupId);
Map<String, String> processorIdToProcessorNameCopy = ImmutableMap.copyOf(processorIdToProcessorName);
Map<String, NiFiFlowCacheConnectionData> connectionDataMapCopy = ImmutableMap.copyOf(connectionIdToConnectionMap);
// get feeds updated since last sync
NifiFlowCacheSnapshot latest = new NifiFlowCacheSnapshot.Builder().withProcessorIdToFeedNameMap(processorIdToFeedNameMapCopy).withProcessorIdToFeedProcessGroupId(processorIdToFeedProcessGroupIdCopy).withProcessorIdToProcessorName(processorIdToProcessorNameCopy).withConnections(connectionDataMapCopy).withSnapshotDate(lastUpdated).build();
return syncAndReturnUpdates(sync, latest, preview);
} else {
return NiFiFlowCacheSync.EMPTY(sync.getSyncId());
}
}
use of com.thinkbiganalytics.metadata.rest.model.nifi.NiFiFlowCacheConnectionData in project kylo by Teradata.
the class NifiFlowCacheImpl method toConnectionIdMap.
private Map<String, NiFiFlowCacheConnectionData> toConnectionIdMap(Collection<NifiFlowConnection> connections) {
Map<String, NiFiFlowCacheConnectionData> connectionMap = new HashMap<>();
connections.stream().forEach(conn -> {
connectionMap.put(conn.getConnectionIdentifier(), new NiFiFlowCacheConnectionData(conn.getConnectionIdentifier(), conn.getName(), conn.getSourceIdentifier(), conn.getDestinationIdentifier()));
});
return connectionMap;
}
Aggregations