title: Spark rdd write to Hbase
body: <p>I am able to read the messages from Kafka using the below code:</p>
  
  <pre><code>val ssc = new StreamingContext(sc, Seconds(50)) 
  val topicmap = Map("test" -&gt; 1)
  val lines = KafkaUtils.createStream(ssc,"127.0.0.1:2181", "test-consumer-group",topicmap)
  </code></pre>
  
  <p>But, I am trying to read each message from Kafka and putting into HBase. This is my code to write into HBase but no success.</p>
  
  <pre><code>lines.foreachRDD(rdd =&gt; {
    rdd.foreach(record =&gt; {
      val i = +1
      val hConf = new HBaseConfiguration() 
      val hTable = new HTable(hConf, "test") 
      val thePut = new Put(Bytes.toBytes(i)) 
      thePut.add(Bytes.toBytes("cf"), Bytes.toBytes("a"), Bytes.toBytes(record)) 
    })
  })
  </code></pre>