hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rabin Banerjee <dev.rabin.baner...@gmail.com>
Subject How to set NameSpace while storing from Spark to HBase using saveAsNewAPIHadoopDataSet
Date Mon, 19 Dec 2016 12:10:12 GMT
HI All,

  I am trying to save data from Spark into HBase using saveHadoopDataSet
API . Please refer the below code . Code is working fine .But the table is
getting stored in the default namespace.how to set the NameSpace in the
below code?

wordCounts.foreachRDD ( rdd =&gt; {
  val conf = HBaseConfiguration.create()
  conf.set(TableOutputFormat.OUTPUT_TABLE, "stream_count")
  conf.set("hbase.zookeeper.quorum", "localhost:2181")
  conf.set("hbase.master", "localhost:60000");
  conf.set("hbase.rootdir", "file:///tmp/hbase")

  val jobConf = new Configuration(conf)
  jobConf.set("mapreduce.job.output.key.class", classOf[Text].getName)
  jobConf.set("mapreduce.job.output.value.class", classOf[LongWritable].
  jobConf.set("mapreduce.outputformat.class", classOf[TableOutputFormat[Text


R Banerjee

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message