Search in sources :

Example 1 with StreamGrouping

use of com.hortonworks.streamline.streams.layout.component.StreamGrouping in project streamline by hortonworks.

the class TopologyComponentFactory method getStreamlineEdge.

public Edge getStreamlineEdge(TopologyEdge topologyEdge) {
    Edge edge = new Edge();
    edge.setId(topologyEdge.getId().toString());
    edge.setFrom(getOutputComponent(topologyEdge));
    edge.setTo(getInputComponent(topologyEdge));
    Set<StreamGrouping> streamGroupings = new HashSet<>();
    for (TopologyEdge.StreamGrouping streamGrouping : topologyEdge.getStreamGroupings()) {
        Stream stream = getStream(catalogService.getStreamInfo(topologyEdge.getTopologyId(), streamGrouping.getStreamId(), topologyEdge.getVersionId()));
        Stream.Grouping grouping = Stream.Grouping.valueOf(streamGrouping.getGrouping().name());
        streamGroupings.add(new StreamGrouping(stream, grouping, streamGrouping.getFields()));
    }
    edge.addStreamGroupings(streamGroupings);
    return edge;
}
Also used : TopologyStream(com.hortonworks.streamline.streams.catalog.TopologyStream) Stream(com.hortonworks.streamline.streams.layout.component.Stream) Edge(com.hortonworks.streamline.streams.layout.component.Edge) TopologyEdge(com.hortonworks.streamline.streams.catalog.TopologyEdge) TopologyEdge(com.hortonworks.streamline.streams.catalog.TopologyEdge) StreamGrouping(com.hortonworks.streamline.streams.layout.component.StreamGrouping) HashSet(java.util.HashSet)

Aggregations

TopologyEdge (com.hortonworks.streamline.streams.catalog.TopologyEdge)1 TopologyStream (com.hortonworks.streamline.streams.catalog.TopologyStream)1 Edge (com.hortonworks.streamline.streams.layout.component.Edge)1 Stream (com.hortonworks.streamline.streams.layout.component.Stream)1 StreamGrouping (com.hortonworks.streamline.streams.layout.component.StreamGrouping)1 HashSet (java.util.HashSet)1