Search in sources :

Example 1 with TopologySourceStreamMap

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;
}
Also used : QueryParam(com.hortonworks.registries.common.QueryParam) WSUtils.versionIdQueryParam(com.hortonworks.streamline.common.util.WSUtils.versionIdQueryParam) WSUtils.buildEdgesFromQueryParam(com.hortonworks.streamline.common.util.WSUtils.buildEdgesFromQueryParam) WSUtils.currentVersionQueryParam(com.hortonworks.streamline.common.util.WSUtils.currentVersionQueryParam) WSUtils.buildEdgesToQueryParam(com.hortonworks.streamline.common.util.WSUtils.buildEdgesToQueryParam) ArrayList(java.util.ArrayList) TopologyStream(com.hortonworks.streamline.streams.catalog.TopologyStream) TopologySourceStreamMap(com.hortonworks.streamline.streams.catalog.TopologySourceStreamMap)

Example 2 with TopologySourceStreamMap

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());
        }
    }
}
Also used : TopologySourceStreamMap(com.hortonworks.streamline.streams.catalog.TopologySourceStreamMap)

Example 3 with TopologySourceStreamMap

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;
}
Also used : QueryParam(com.hortonworks.registries.common.QueryParam) WSUtils.versionIdQueryParam(com.hortonworks.streamline.common.util.WSUtils.versionIdQueryParam) WSUtils.buildEdgesFromQueryParam(com.hortonworks.streamline.common.util.WSUtils.buildEdgesFromQueryParam) WSUtils.currentVersionQueryParam(com.hortonworks.streamline.common.util.WSUtils.currentVersionQueryParam) WSUtils.buildEdgesToQueryParam(com.hortonworks.streamline.common.util.WSUtils.buildEdgesToQueryParam) ArrayList(java.util.ArrayList) TopologySourceStreamMap(com.hortonworks.streamline.streams.catalog.TopologySourceStreamMap)

Aggregations

TopologySourceStreamMap (com.hortonworks.streamline.streams.catalog.TopologySourceStreamMap)3 QueryParam (com.hortonworks.registries.common.QueryParam)2 WSUtils.buildEdgesFromQueryParam (com.hortonworks.streamline.common.util.WSUtils.buildEdgesFromQueryParam)2 WSUtils.buildEdgesToQueryParam (com.hortonworks.streamline.common.util.WSUtils.buildEdgesToQueryParam)2 WSUtils.currentVersionQueryParam (com.hortonworks.streamline.common.util.WSUtils.currentVersionQueryParam)2 WSUtils.versionIdQueryParam (com.hortonworks.streamline.common.util.WSUtils.versionIdQueryParam)2 ArrayList (java.util.ArrayList)2 TopologyStream (com.hortonworks.streamline.streams.catalog.TopologyStream)1