public StreamlineComponent() { config = new Config(); }
public TopologyLayout(Long id, String name, String configStr, TopologyDag topologyDag) throws IOException { this.id = id; this.name = name; if (!StringUtils.isEmpty(configStr)) { ObjectMapper mapper = new ObjectMapper(); Map<String, Object> properties = mapper.readValue(configStr, new TypeReference<Map<String, Object>>(){}); config = new Config(); config.putAll(properties); } else { config = new Config(); } this.topologyDag = topologyDag; }
public StreamlineComponent(StreamlineComponent other) { this.id = other.id; this.topologyComponentBundleId = other.topologyComponentBundleId; this.name = other.name; this.config = new Config(other.getConfig()); this.transformationClass = other.transformationClass; }
@Override public void visit(StreamlineSource source) { String id = source.getId(); String sourceName = source.getName(); if (!testRunSourcesForEachSource.containsKey(sourceName)) { throw new IllegalStateException("Not all sources have corresponding TestRunSource instance. source name: " + sourceName); } Config config = new Config(source.getConfig()); TestRunSource testRunSource = testRunSourcesForEachSource.get(sourceName); testRunSource.setId(id); testRunSource.setName(sourceName); testRunSource.setConfig(config); testRunSource.setTransformationClass(TestRunSourceSpoutFluxComponent.class.getName()); testTopologyDag.add(testRunSource); sourceToReplacedTestSourceMap.put(sourceName, testRunSource); }
@Override public void visit(RulesProcessor rulesProcessor) { String id = rulesProcessor.getId(); String processorName = rulesProcessor.getName(); if (!testRunRulesProcessorsForEachProcessor.containsKey(processorName)) { throw new IllegalStateException("Not all processors have corresponding TestRunRulesProcessor instance. processor name: " + processorName); } Config config = new Config(rulesProcessor.getConfig()); TestRunRulesProcessor testRunRulesProcessor = testRunRulesProcessorsForEachProcessor.get(processorName); testRunRulesProcessor.setId(id); testRunRulesProcessor.setName(processorName); testRunRulesProcessor.setConfig(config); testRunRulesProcessor.setTransformationClass(TestRunRulesProcessorBoltFluxComponent.class.getName()); testTopologyDag.add(testRunRulesProcessor); processorToReplacedTestProcessorMap.put(processorName, testRunRulesProcessor); copyEdges(rulesProcessor); }
@Override public void visit(StreamlineSink sink) { String id = sink.getId(); String sinkName = sink.getName(); if (!testRunSinksForEachSink.containsKey(sinkName)) { throw new IllegalStateException("Not all sinks have corresponding TestRunSink instance. sink name: " + sinkName); } Config config = new Config(sink.getConfig()); TestRunSink testRunSink = testRunSinksForEachSink.get(sinkName); testRunSink.setId(id); testRunSink.setName(sinkName); testRunSink.setConfig(config); testRunSink.setTransformationClass(TestRunSinkBoltFluxComponent.class.getName()); testTopologyDag.add(testRunSink); sinkToReplacedTestSinkMap.put(sinkName, testRunSink); copyEdges(sink); }
@Override public void visit(StreamlineProcessor processor) { String id = processor.getId(); String processorName = processor.getName(); if (!testRunProcessorsForEachProcessor.containsKey(processorName)) { throw new IllegalStateException("Not all processors have corresponding TestRunProcessor instance. processor name: " + processorName); } Config config = new Config(processor.getConfig()); TestRunProcessor testRunProcessor = testRunProcessorsForEachProcessor.get(processorName); testRunProcessor.setId(id); testRunProcessor.setName(processorName); testRunProcessor.setConfig(config); testRunProcessor.setTransformationClass(TestRunProcessorBoltFluxComponent.class.getName()); testTopologyDag.add(testRunProcessor); processorToReplacedTestProcessorMap.put(processorName, testRunProcessor); copyEdges(processor); }
config = new Config();
public TopologyComponent(TopologyComponent other) { if (other != null) { setId(other.getId()); setTopologyId(other.getTopologyId()); setTopologyComponentBundleId(other.getTopologyComponentBundleId()); setVersionId(other.getVersionId()); setName(other.getName()); setDescription(other.getDescription()); setConfig(new Config(other.getConfig())); setVersionTimestamp(other.getVersionTimestamp()); } }