use of com.hortonworks.streamline.streams.layout.component.StreamlineComponent 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;
}
use of com.hortonworks.streamline.streams.layout.component.StreamlineComponent in project streamline by hortonworks.
the class TopologyComponentFactory method getStreamlineComponent.
private <T extends StreamlineComponent> T getStreamlineComponent(Class<T> clazz, TopologyComponent topologyComponent) {
if (topologyComponent.getReconfigure()) {
throw new IllegalStateException("Topology component " + topologyComponent + " must be reconfigured");
}
TopologyComponentBundle topologyComponentBundle = getTopologyComponentBundle(topologyComponent);
StreamlineComponent component = getProvider(clazz, topologyComponentBundle.getSubType()).create(topologyComponent);
component.setId(topologyComponent.getId().toString());
component.setName(topologyComponent.getName());
component.setConfig(topologyComponent.getConfig());
component.setTopologyComponentBundleId(topologyComponentBundle.getId().toString());
component.setTransformationClass(topologyComponentBundle.getTransformationClass());
return clazz.cast(component);
}
Aggregations