title: How to write to HBase from Spark Streaming
body: <p>Referring to my other question "Writing to HBase from Spark Streaming", I was advised to follow <a href="https://www.mapr.com/blog/spark-streaming-hbase" rel="nofollow">https://www.mapr.com/blog/spark-streaming-hbase</a> in order to write to HBase from Spark Streaming and that's what I did (with modification according to my need), when running Spark-submit, there is no error but also that data is not written into HBase, I'll show you the code if you could please figure out if I did something wrong and how to correct it :</p>
  
  <pre><code>val conf = HBaseConfiguration.create()
      val jobConfig: JobConf = new JobConf(conf)
      jobConfig.setOutputFormat(classOf[TableOutputFormat])
      jobConfig.set(TableOutputFormat.OUTPUT_TABLE, "tabName")
  Dstream.foreachRDD(rdd =&gt;
              rdd.map(Convert.toPut).saveAsHadoopDataset(jobConfig))
  </code></pre>
  
  <p>with :</p>
  
  <pre><code>object Convert{
    def toPut (parametre: (String,String)): (ImmutableBytesWritable, Put) = {
      val put = new Put(Bytes.toBytes(1))
      put.add(Bytes.toBytes("colfamily"), Bytes.toBytes(parametre._1), Bytes.toBytes(parametre._2))
      return (new ImmutableBytesWritable(Bytes.toBytes(1)), put)
    }
  </code></pre>
  
  <p>Could you please help me find out what I'm doing wrong here ?
  Thank you in advance</p>