<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Spark and HBase in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Spark-and-HBase/m-p/155614#M118053</link>
    <description>&lt;P&gt;Solved &lt;/P&gt;&lt;P&gt;Many thanks &lt;/P&gt;&lt;P&gt;I will try to remove the slashes on addresource and see if it solves also&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;</description>
    <pubDate>Thu, 19 May 2016 01:18:09 GMT</pubDate>
    <dc:creator>az1</dc:creator>
    <dc:date>2016-05-19T01:18:09Z</dc:date>
    <item>
      <title>Spark and HBase</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-and-HBase/m-p/155608#M118047</link>
      <description>&lt;P&gt;I am trying to write to HBase from SparkStreaming job. &lt;/P&gt;&lt;P&gt;I get the following exception when calling: &lt;/P&gt;&lt;P&gt;table.put(_config,put); &lt;/P&gt;&lt;P&gt;java.lang.NullPointerException&lt;/P&gt;&lt;P&gt;at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.getMetaReplicaNodes(ZooKeeperWatcher.java:269)&lt;/P&gt;&lt;P&gt;I see that the configuration value is not correct but I tried to set up values I don't know exactly which values to setup 
&lt;/P&gt;&lt;P&gt;I am running on azure with hortonworks sandbox and running the job via spark-submit with --jars supplying the entire jars needed to run. (spark version 1.6)&lt;/P&gt;&lt;P&gt;The streaming is running perfect except that I cant write to HBase &lt;/P&gt;&lt;P&gt;Here is my code to put data:&lt;/P&gt;&lt;PRE&gt;class Adapter extendsSerializable{&lt;/PRE&gt;
&lt;PRE&gt;var_conf = new HBaseConfiguration()&lt;/PRE&gt;
&lt;PRE&gt;val_admin = new HBaseAdmin(_conf)&lt;/PRE&gt;

&lt;PRE&gt;defPutData(tableName:String,columnFamily:String,key:String,data:String){&lt;/PRE&gt;
&lt;PRE&gt;//  _conf = HBaseConfiguration.create().asInstanceOf[HBaseConfiguration]&lt;/PRE&gt;

&lt;PRE&gt;        _conf.addResource("//etc//hbase//conf//hbase-site.xml")&lt;/PRE&gt;
&lt;PRE&gt;        _conf.set("hbase.zookeeper.quorum","sandbox.hortonworks.com");&lt;/PRE&gt;
&lt;PRE&gt;        _conf.setInt("hbase.zookeeper.clientport",2181);&lt;/PRE&gt;
&lt;PRE&gt;println(_conf.get("hbase.zookeeper.quorum")); &lt;/PRE&gt;
&lt;PRE&gt;println(_conf.get("hbase.zookeeper.clientport"));&lt;/PRE&gt;

&lt;PRE&gt;valtable = new HTable(_conf,tableName)&lt;/PRE&gt;
&lt;PRE&gt;valput = new Put(Bytes.toBytes(key));&lt;/PRE&gt;
&lt;PRE&gt;valobj = JSON.parseFull(data); &lt;/PRE&gt;

&lt;PRE&gt;objmatch {&lt;/PRE&gt;
&lt;PRE&gt;caseSome(m:Map[String,Any])=&amp;gt;&lt;/PRE&gt;

&lt;PRE&gt;m.map((r)=&amp;gt;{&lt;/PRE&gt;
&lt;PRE&gt;valv=r._2.asInstanceOf[String];&lt;/PRE&gt;
&lt;PRE&gt;put.add(Bytes.toBytes(columnFamily),Bytes.toBytes(r._1),Bytes.toBytes(v))&lt;/PRE&gt;
&lt;PRE&gt;//println(r._1+":"+v)&lt;/PRE&gt;
&lt;PRE&gt;          })&lt;/PRE&gt;
&lt;PRE&gt;      }      &lt;/PRE&gt;

&lt;PRE&gt;println("writing to HBase"); &lt;/PRE&gt;
&lt;PRE&gt;table.put(put); &lt;/PRE&gt;
&lt;PRE&gt;  }&lt;/PRE&gt;
&lt;PRE&gt;}&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 May 2016 00:08:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-and-HBase/m-p/155608#M118047</guid>
      <dc:creator>az1</dc:creator>
      <dc:date>2016-05-19T00:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: Spark and HBase</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-and-HBase/m-p/155609#M118048</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/1262/az.html" nodeid="1262"&gt;@Avraha Zilberma&lt;/A&gt;&lt;P&gt;Try setting zookeeper znode property as per your cluster conf, it will help.&lt;/P&gt;&lt;P&gt;conf.set("zookeeper.znode.parent", "VALUE") &lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2016 00:19:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-and-HBase/m-p/155609#M118048</guid>
      <dc:creator>jyadav</dc:creator>
      <dc:date>2016-05-19T00:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: Spark and HBase</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-and-HBase/m-p/155610#M118049</link>
      <description>&lt;P&gt;Hi thank you for the answer .&lt;/P&gt;&lt;P&gt;Tried it &lt;/P&gt;&lt;P&gt;Didn't help the same exception &lt;/P&gt;&lt;P&gt;I put the following code: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_conf.set("zookeeper.znode.parent", "//hbase-unsecure")  //copied the value from the configuration file &lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2016 00:23:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-and-HBase/m-p/155610#M118049</guid>
      <dc:creator>az1</dc:creator>
      <dc:date>2016-05-19T00:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Spark and HBase</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-and-HBase/m-p/155611#M118050</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1262/az.html" nodeid="1262"&gt;@Avraha Zilberman&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Why your confs have double slash( "//") in path everywhere? &lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2016 00:31:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-and-HBase/m-p/155611#M118050</guid>
      <dc:creator>jyadav</dc:creator>
      <dc:date>2016-05-19T00:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: Spark and HBase</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-and-HBase/m-p/155612#M118051</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi thank you for the answer .&lt;/P&gt;&lt;P&gt;Tried it &lt;/P&gt;&lt;P&gt;Didn't help the same exception &lt;/P&gt;&lt;P&gt;I put the following code: &lt;/P&gt;&lt;P&gt;_conf.set("zookeeper.znode.parent", "//hbase-unsecure") //copied the value from the configuration file &lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2016 00:39:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-and-HBase/m-p/155612#M118051</guid>
      <dc:creator>az1</dc:creator>
      <dc:date>2016-05-19T00:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: Spark and HBase</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-and-HBase/m-p/155613#M118052</link>
      <description>&lt;P&gt;Can you please remove one "/" from "//hbase-unsecure" and try again? &lt;A rel="user" href="https://community.cloudera.com/users/1262/az.html" nodeid="1262"&gt;@Avraha Zilberman&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2016 00:46:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-and-HBase/m-p/155613#M118052</guid>
      <dc:creator>jyadav</dc:creator>
      <dc:date>2016-05-19T00:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: Spark and HBase</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-and-HBase/m-p/155614#M118053</link>
      <description>&lt;P&gt;Solved &lt;/P&gt;&lt;P&gt;Many thanks &lt;/P&gt;&lt;P&gt;I will try to remove the slashes on addresource and see if it solves also&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2016 01:18:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-and-HBase/m-p/155614#M118053</guid>
      <dc:creator>az1</dc:creator>
      <dc:date>2016-05-19T01:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: Spark and HBase</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Spark-and-HBase/m-p/155615#M118054</link>
      <description>&lt;P&gt;I believe it should be like
_conf.set("zookeeper.znode.parent", "/hbase-unsecure")&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2016 12:54:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Spark-and-HBase/m-p/155615#M118054</guid>
      <dc:creator>hora_amit</dc:creator>
      <dc:date>2016-05-26T12:54:16Z</dc:date>
    </item>
  </channel>
</rss>

