Search in sources :

Example 1 with TopologyDagVisitor

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

the class CatalogToLayoutConverter method getComponentLayout.

public static com.hortonworks.streamline.streams.layout.component.Component getComponentLayout(TopologyComponent component) {
    StreamlineComponent componentLayout;
    if (component instanceof TopologySource) {
        componentLayout = new StreamlineSource() {

            @Override
            public void accept(TopologyDagVisitor visitor) {
                throw new UnsupportedOperationException("Not intended to be called here.");
            }
        };
    } else if (component instanceof TopologyProcessor) {
        componentLayout = new StreamlineProcessor() {

            @Override
            public void accept(TopologyDagVisitor visitor) {
                throw new UnsupportedOperationException("Not intended to be called here.");
            }
        };
    } else if (component instanceof TopologySink) {
        componentLayout = new StreamlineSink() {

            @Override
            public void accept(TopologyDagVisitor visitor) {
                throw new UnsupportedOperationException("Not intended to be called here.");
            }
        };
    } else {
        componentLayout = new StreamlineComponent() {

            @Override
            public void accept(TopologyDagVisitor visitor) {
                throw new UnsupportedOperationException("Not intended to be called here.");
            }
        };
    }
    componentLayout.setId(component.getId().toString());
    componentLayout.setName(component.getName());
    componentLayout.setConfig(component.getConfig());
    return componentLayout;
}
Also used : StreamlineProcessor(com.hortonworks.streamline.streams.layout.component.StreamlineProcessor) TopologyDagVisitor(com.hortonworks.streamline.streams.layout.component.TopologyDagVisitor) StreamlineComponent(com.hortonworks.streamline.streams.layout.component.StreamlineComponent) StreamlineSource(com.hortonworks.streamline.streams.layout.component.StreamlineSource) StreamlineSink(com.hortonworks.streamline.streams.layout.component.StreamlineSink)

Example 2 with TopologyDagVisitor

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

the class StormTopologyTimeSeriesMetricsImplTest method getSourceLayoutForTest.

private Component getSourceLayoutForTest() {
    StreamlineSource source = new StreamlineSource() {

        @Override
        public void accept(TopologyDagVisitor visitor) {
        }
    };
    source.setId("11");
    source.setName("device");
    Map<String, String> configurations = buildSourceConfigWithKafkaTopic(TOPIC_NAME);
    source.setConfig(new Config(configurations));
    return source;
}
Also used : TopologyDagVisitor(com.hortonworks.streamline.streams.layout.component.TopologyDagVisitor) Config(com.hortonworks.streamline.common.Config) StreamlineSource(com.hortonworks.streamline.streams.layout.component.StreamlineSource)

Example 3 with TopologyDagVisitor

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

the class StormTopologyTimeSeriesMetricsImplTest method getProcessorLayoutForTest.

private Component getProcessorLayoutForTest() {
    StreamlineProcessor processor = new StreamlineProcessor() {

        @Override
        public void accept(TopologyDagVisitor visitor) {
        }
    };
    processor.setId("12");
    processor.setName("rule");
    return processor;
}
Also used : StreamlineProcessor(com.hortonworks.streamline.streams.layout.component.StreamlineProcessor) TopologyDagVisitor(com.hortonworks.streamline.streams.layout.component.TopologyDagVisitor)

Example 4 with TopologyDagVisitor

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

the class StormTopologyTimeSeriesMetricsImplTest method getSinkLayoutForTest.

private Component getSinkLayoutForTest() {
    StreamlineSink sink = new StreamlineSink() {

        @Override
        public void accept(TopologyDagVisitor visitor) {
        }
    };
    sink.setId("13");
    sink.setName("hdfs");
    return sink;
}
Also used : TopologyDagVisitor(com.hortonworks.streamline.streams.layout.component.TopologyDagVisitor) StreamlineSink(com.hortonworks.streamline.streams.layout.component.StreamlineSink)

Aggregations

TopologyDagVisitor (com.hortonworks.streamline.streams.layout.component.TopologyDagVisitor)4 StreamlineProcessor (com.hortonworks.streamline.streams.layout.component.StreamlineProcessor)2 StreamlineSink (com.hortonworks.streamline.streams.layout.component.StreamlineSink)2 StreamlineSource (com.hortonworks.streamline.streams.layout.component.StreamlineSource)2 Config (com.hortonworks.streamline.common.Config)1 StreamlineComponent (com.hortonworks.streamline.streams.layout.component.StreamlineComponent)1