Search in sources :

Example 1 with StageProcessor

use of com.hortonworks.streamline.streams.layout.component.impl.splitjoin.StageProcessor in project streamline by hortonworks.

the class TopologyComponentFactory method stageProcessorProvider.

private Map.Entry<String, Provider<StreamlineProcessor>> stageProcessorProvider() {
    Provider<StreamlineProcessor> provider = new Provider<StreamlineProcessor>() {

        @Override
        public StreamlineProcessor create(TopologyComponent component) {
            Object stageConfig = component.getConfig().getAny(StageProcessor.CONFIG_KEY_STAGE);
            ObjectMapper objectMapper = new ObjectMapper();
            StageAction stageAction = objectMapper.convertValue(stageConfig, StageAction.class);
            StageProcessor stageProcessor = new StageProcessor();
            stageProcessor.setStageAction(stageAction);
            return stageProcessor;
        }
    };
    return new SimpleImmutableEntry<>(STAGE, provider);
}
Also used : TopologyComponent(com.hortonworks.streamline.streams.catalog.TopologyComponent) StreamlineProcessor(com.hortonworks.streamline.streams.layout.component.StreamlineProcessor) StageProcessor(com.hortonworks.streamline.streams.layout.component.impl.splitjoin.StageProcessor) SimpleImmutableEntry(java.util.AbstractMap.SimpleImmutableEntry) StageAction(com.hortonworks.streamline.streams.layout.component.impl.splitjoin.StageAction) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Aggregations

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 TopologyComponent (com.hortonworks.streamline.streams.catalog.TopologyComponent)1 StreamlineProcessor (com.hortonworks.streamline.streams.layout.component.StreamlineProcessor)1 StageAction (com.hortonworks.streamline.streams.layout.component.impl.splitjoin.StageAction)1 StageProcessor (com.hortonworks.streamline.streams.layout.component.impl.splitjoin.StageProcessor)1 SimpleImmutableEntry (java.util.AbstractMap.SimpleImmutableEntry)1