use of com.hortonworks.streamline.common.Config in project streamline by hortonworks.
the class StormTopologyDependenciesHandler method handleComponentMavenArtifactsConfigForStreamlineComponent.
private void handleComponentMavenArtifactsConfigForStreamlineComponent(StreamlineComponent streamlineComponent) {
Config config = streamlineComponent.getConfig();
if (config != null) {
String componentMavenArtifacts = config.get(COMPONENT_CONFIG_KEY_MAVEN_ARTIFACTS, "");
if (!componentMavenArtifacts.isEmpty()) {
LOG.debug("Adding component dependency artifact: %s", componentMavenArtifacts);
mavenArtifacts.add(componentMavenArtifacts);
}
}
}
use of com.hortonworks.streamline.common.Config in project streamline by hortonworks.
the class TopologyTestHelper method createStreamlineProcessor.
public static StreamlineProcessor createStreamlineProcessor(String id) {
Stream stream = createDefaultStream();
StreamlineProcessor processor = new StreamlineProcessor(Sets.newHashSet(stream));
processor.setId(id);
processor.setName("testProcessor_" + id);
processor.setConfig(new Config());
processor.setTransformationClass("dummyTransformation");
return processor;
}
use of com.hortonworks.streamline.common.Config in project streamline by hortonworks.
the class TopologyTestHelper method createRulesProcessor.
public static RulesProcessor createRulesProcessor(String id) {
RulesProcessor processor = new RulesProcessor();
processor.setId(id);
processor.setName("testRuleProcessor_" + id);
processor.setConfig(new Config());
processor.setTransformationClass("dummyTransformation");
processor.setProcessAll(true);
processor.setRules(Collections.emptyList());
return processor;
}
use of com.hortonworks.streamline.common.Config in project streamline by hortonworks.
the class TopologyComponentFactory method normalizationProcessorProvider.
private Map.Entry<String, Provider<StreamlineProcessor>> normalizationProcessorProvider() {
Provider<StreamlineProcessor> provider = new Provider<StreamlineProcessor>() {
@Override
public StreamlineProcessor create(TopologyComponent component) {
Config config = component.getConfig();
Object typeObj = config.getAny(NormalizationProcessor.CONFIG_KEY_TYPE);
Object normConfObj = config.getAny(NormalizationProcessor.CONFIG_KEY_NORMALIZATION);
ObjectMapper objectMapper = new ObjectMapper();
NormalizationProcessor.Type type = objectMapper.convertValue(typeObj, NormalizationProcessor.Type.class);
Map<String, NormalizationConfig> normConfig = objectMapper.convertValue(normConfObj, new TypeReference<Map<String, NormalizationConfig>>() {
});
updateWithSchemas(component.getTopologyId(), component.getVersionId(), normConfig);
Set<Stream> outputStreams;
if (component instanceof TopologyOutputComponent) {
outputStreams = createOutputStreams((TopologyOutputComponent) component);
} else {
throw new IllegalArgumentException("Component " + component + " must be an instance of TopologyOutputComponent");
}
if (outputStreams.size() != 1) {
throw new IllegalArgumentException("Normalization component [" + component + "] must have only one output stream");
}
return new NormalizationProcessor(normConfig, outputStreams.iterator().next(), type);
}
};
return new SimpleImmutableEntry<>(NORMALIZATION, provider);
}
use of com.hortonworks.streamline.common.Config in project streamline by hortonworks.
the class TopologyComponent method setConfigData.
@JsonIgnore
public void setConfigData(String configData) throws Exception {
if (!StringUtils.isEmpty(configData)) {
ObjectMapper mapper = new ObjectMapper();
config = mapper.readValue(configData, Config.class);
}
}
Aggregations