Package com.hmsonline.storm.cassandra.bolt.mapper

Examples of com.hmsonline.storm.cassandra.bolt.mapper.DefaultTupleMapper


        // DelimitedColumnLookupBolt followersBolt =
        // new DelimitedColumnLookupBolt("followers_delimited", "tweeter",
        // "followers", ":", "rowKey", "follower", true);

        // cf = "tweeters", rowkey = tuple["url"]
        TupleMapper<String, String, String> tweetersTupleMapper = new DefaultTupleMapper("stormks", "tweeters", "url");
        // cf (url -> tweeters) -> emit(url, follower)
        ColumnMapper<String, String, String> tweetersColumnsMapper = new ValuelessColumnsMapper("url", "tweeter", true);
        CassandraLookupBolt<String, String, String> tweetersBolt = new CassandraLookupBolt<String, String, String>(configKey,
                tweetersTupleMapper, tweetersColumnsMapper);

        // cf = "followers", rowkey = tuple["tweeter"]
        TupleMapper<String, String, String> followersTupleMapper = new DefaultTupleMapper("stormks", "followers", "tweeter");
        // cf (tweeter -> followers) ==> emit(url, follower)
        ValuelessColumnsMapper followersColumnsMapper = new ValuelessColumnsMapper("url", "follower", true);
        CassandraLookupBolt<String, String, String> followersBolt = new CassandraLookupBolt<String, String, String>(configKey,
                followersTupleMapper, followersColumnsMapper);
View Full Code Here


        TestWordCounter countBolt = new TestWordCounter();

        // create a CassandraBolt that writes to the "stormcf" column
        // family and uses the Tuple field "word" as the row key
        CassandraBatchingBolt<String, String, String> cassandraBolt = new CassandraBatchingBolt<String, String, String>(configKey,
                new DefaultTupleMapper("stormks", "stormcf", "word"));
        cassandraBolt.setAckStrategy(AckStrategy.ACK_ON_WRITE);

        // setup topology:
        // wordSpout ==> countBolt ==> cassandraBolt
        TopologyBuilder builder = new TopologyBuilder();
View Full Code Here

    }


    @Test
    public void testBolt() throws Exception {
        TupleMapper<String, String, String> tupleMapper = new DefaultTupleMapper(KEYSPACE, "users", "VALUE");
        String configKey = "cassandra-config";
        CassandraBatchingBolt<String, String, String> bolt = new CassandraBatchingBolt<String, String, String>(configKey, tupleMapper);
        TopologyBuilder builder = new TopologyBuilder();
        builder.setBolt("TEST_BOLT", bolt);
View Full Code Here

TOP

Related Classes of com.hmsonline.storm.cassandra.bolt.mapper.DefaultTupleMapper

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.