Package storm.kafka.trident.selector

Examples of storm.kafka.trident.selector.DefaultTopicSelector


        TridentTopology topology = new TridentTopology();
        Stream stream = topology.newStream("spout1", spout);

        TridentKafkaStateFactory stateFactory = new TridentKafkaStateFactory()
                .withKafkaTopicSelector(new DefaultTopicSelector("test"))
                .withTridentTupleToKafkaMapper(new FieldNameBasedTupleToKafkaMapper("word", "count"));
        stream.partitionPersist(stateFactory, fields, new TridentKafkaUpdater(), new Fields());

        return topology.build();
    }
View Full Code Here


    public void setup() {
        broker = new KafkaTestBroker();
        simpleConsumer = TestUtils.getKafkaConsumer(broker);
        config = TestUtils.getConfig(broker.getBrokerConnectionString());
        mapper = new FieldNameBasedTupleToKafkaMapper("key", "message");
        topicSelector = new DefaultTopicSelector(TestUtils.TOPIC);
        state = new TridentKafkaState()
                .withKafkaTopicSelector(topicSelector)
                .withTridentTupleToKafkaMapper(mapper);
        state.prepare(config);
    }
View Full Code Here

TOP

Related Classes of storm.kafka.trident.selector.DefaultTopicSelector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.