use of com.hortonworks.streamline.streams.catalog.TopologyProcessorStreamMap in project streamline by hortonworks.
the class StreamCatalogService method removeProcessorStreamMapping.
private void removeProcessorStreamMapping(TopologyProcessor topologyProcessor, List<Long> streamIds) {
if (topologyProcessor != null) {
for (Long outputStreamId : streamIds) {
TopologyProcessorStreamMap mapping = new TopologyProcessorStreamMap(topologyProcessor.getId(), topologyProcessor.getVersionId(), outputStreamId);
dao.<TopologyProcessorStreamMap>remove(mapping.getStorableKey());
}
}
}
use of com.hortonworks.streamline.streams.catalog.TopologyProcessorStreamMap in project streamline by hortonworks.
the class StreamCatalogService method getOutputStreams.
private List<TopologyStream> getOutputStreams(TopologyProcessor topologyProcessor) {
List<TopologyStream> streams = new ArrayList<>();
if (topologyProcessor != null) {
QueryParam qp1 = new QueryParam(TopologyProcessorStreamMap.FIELD_PROCESSOR_ID, String.valueOf(topologyProcessor.getId()));
QueryParam qp2 = new QueryParam(TopologyProcessorStreamMap.FIELD_VERSION_ID, String.valueOf(topologyProcessor.getVersionId()));
for (TopologyProcessorStreamMap mapping : listTopologyProcessorStreamMapping(ImmutableList.of(qp1, qp2))) {
TopologyStream topologyStream = getStreamInfo(topologyProcessor.getTopologyId(), mapping.getStreamId(), topologyProcessor.getVersionId());
if (topologyStream != null) {
streams.add(topologyStream);
}
}
}
return streams;
}
use of com.hortonworks.streamline.streams.catalog.TopologyProcessorStreamMap in project streamline by hortonworks.
the class StreamCatalogService method createProcessorStreamMapping.
private void createProcessorStreamMapping(TopologyProcessor topologyProcessor, List<TopologyStream> streams) {
for (TopologyStream outputStream : streams) {
TopologyStream addedStream = addStreamInfo(topologyProcessor.getTopologyId(), outputStream);
dao.<TopologyProcessorStreamMap>add(new TopologyProcessorStreamMap(topologyProcessor.getId(), topologyProcessor.getVersionId(), addedStream.getId()));
}
}
use of com.hortonworks.streamline.streams.catalog.TopologyProcessorStreamMap in project streamline by hortonworks.
the class StreamCatalogService method getOutputStreamIds.
private List<Long> getOutputStreamIds(TopologyProcessor topologyProcessor) {
List<Long> streamIds = new ArrayList<>();
if (topologyProcessor != null) {
QueryParam qp1 = new QueryParam(TopologyProcessorStreamMap.FIELD_PROCESSOR_ID, String.valueOf(topologyProcessor.getId()));
QueryParam qp2 = new QueryParam(TopologyProcessorStreamMap.FIELD_VERSION_ID, String.valueOf(topologyProcessor.getVersionId()));
for (TopologyProcessorStreamMap mapping : listTopologyProcessorStreamMapping(ImmutableList.of(qp1, qp2))) {
streamIds.add(mapping.getStreamId());
}
}
return streamIds;
}
Aggregations