use of com.hortonworks.streamline.streams.catalog.TopologySourceStreamMap in project streamline by hortonworks.
the class StreamCatalogService method getOutputStreams.
private List<TopologyStream> getOutputStreams(TopologySource topologySource) {
List<TopologyStream> streams = new ArrayList<>();
if (topologySource != null) {
QueryParam qp1 = new QueryParam(TopologySourceStreamMap.FIELD_SOURCE_ID, String.valueOf(topologySource.getId()));
QueryParam qp2 = new QueryParam(TopologySourceStreamMap.FIELD_VERSION_ID, String.valueOf(topologySource.getVersionId()));
for (TopologySourceStreamMap mapping : listTopologySourceStreamMapping(ImmutableList.of(qp1, qp2))) {
TopologyStream topologyStream = getStreamInfo(topologySource.getTopologyId(), mapping.getStreamId(), topologySource.getVersionId());
if (topologyStream != null) {
streams.add(topologyStream);
}
}
}
return streams;
}
use of com.hortonworks.streamline.streams.catalog.TopologySourceStreamMap in project streamline by hortonworks.
the class StreamCatalogService method removeSourceStreamMapping.
private void removeSourceStreamMapping(TopologySource topologySource, List<Long> streamIds) {
if (topologySource != null) {
for (Long outputStreamId : streamIds) {
TopologySourceStreamMap mapping = new TopologySourceStreamMap(topologySource.getId(), topologySource.getVersionId(), outputStreamId);
dao.<TopologySourceStreamMap>remove(mapping.getStorableKey());
}
}
}
use of com.hortonworks.streamline.streams.catalog.TopologySourceStreamMap in project streamline by hortonworks.
the class StreamCatalogService method getOutputStreamIds.
private List<Long> getOutputStreamIds(TopologySource topologySource) {
List<Long> streamIds = new ArrayList<>();
if (topologySource != null) {
QueryParam qp1 = new QueryParam(TopologySourceStreamMap.FIELD_SOURCE_ID, String.valueOf(topologySource.getId()));
QueryParam qp2 = new QueryParam(TopologySourceStreamMap.FIELD_VERSION_ID, String.valueOf(topologySource.getVersionId()));
for (TopologySourceStreamMap mapping : listTopologySourceStreamMapping(ImmutableList.of(qp1, qp2))) {
streamIds.add(mapping.getStreamId());
}
}
return streamIds;
}
Aggregations