Search in sources :

Example 1 with HBaseBolt

use of backtype.storm.contrib.hbase.bolts.HBaseBolt in project storm-hbase by jrkinley.

the class HBaseExampleTopology method main.

/**
   * @param args
   */
public static void main(String[] args) {
    TopologyBuilder builder = new TopologyBuilder();
    // Add test spout
    builder.setSpout("spout", new TestSpout(), 1);
    // Build TupleTableConifg
    TupleTableConfig config = new TupleTableConfig("shorturl", "shortid");
    config.setBatch(false);
    config.addColumn("data", "url");
    config.addColumn("data", "user");
    config.addColumn("data", "date");
    // Add HBaseBolt
    builder.setBolt("hbase", new HBaseBolt(config), 1).shuffleGrouping("spout");
    Config stormConf = new Config();
    stormConf.setDebug(true);
    LocalCluster cluster = new LocalCluster();
    cluster.submitTopology("hbase-example", stormConf, builder.createTopology());
    Utils.sleep(10000);
    cluster.shutdown();
}
Also used : LocalCluster(backtype.storm.LocalCluster) TopologyBuilder(backtype.storm.topology.TopologyBuilder) Config(backtype.storm.Config) TupleTableConfig(backtype.storm.contrib.hbase.utils.TupleTableConfig) TupleTableConfig(backtype.storm.contrib.hbase.utils.TupleTableConfig) HBaseBolt(backtype.storm.contrib.hbase.bolts.HBaseBolt)

Aggregations

Config (backtype.storm.Config)1 LocalCluster (backtype.storm.LocalCluster)1 HBaseBolt (backtype.storm.contrib.hbase.bolts.HBaseBolt)1 TupleTableConfig (backtype.storm.contrib.hbase.utils.TupleTableConfig)1 TopologyBuilder (backtype.storm.topology.TopologyBuilder)1