<?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 HBASE JAVA API issues in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HBASE-JAVA-API-issues/m-p/219176#M79392</link>
    <description>&lt;P&gt;I am running a simple HBASE JAva code to create a table but I am getting this error &lt;/P&gt;&lt;PRE&gt;.6.4.0-91/phoenix/phoenix-client.jar:/usr/hdp/2.6.4.0-91/phoenix/phoenix-server.jar://usr/hdp/2.6.4.0-91/hbase/conf/hbase-site.xml:.
18/06/08 16:19:41 INFO zookeeper.ZooKeeper: Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
18/06/08 16:19:41 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=/tmp
18/06/08 16:19:41 INFO zookeeper.ZooKeeper: Client environment:java.compiler=&amp;lt;NA&amp;gt;
18/06/08 16:19:41 INFO zookeeper.ZooKeeper: Client environment:os.name=Linux
18/06/08 16:19:41 INFO zookeeper.ZooKeeper: Client environment:os.arch=amd64
18/06/08 16:19:41 INFO zookeeper.ZooKeeper: Client environment:os.version=2.6.32-642.6.2.el6.x86_64
18/06/08 16:19:41 INFO zookeeper.ZooKeeper: Client environment:user.name=root
18/06/08 16:19:41 INFO zookeeper.ZooKeeper: Client environment:user.home=/root
18/06/08 16:19:41 INFO zookeeper.ZooKeeper: Client environment:user.dir=/root
18/06/08 16:19:41 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2181 sessionTimeout=90000 watcher=org.apache.hadoop.hbase.zookeeper.PendingWatcher@5158b42f
18/06/08 16:19:41 DEBUG zookeeper.ClientCnxn: zookeeper.disableAutoWatchReset is false
18/06/08 16:19:41 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
18/06/08 16:19:41 INFO zookeeper.ClientCnxn: Socket connection established, initiating session, client: /127.0.0.1:39668, server: localhost/127.0.0.1:2181
18/06/08 16:19:41 DEBUG zookeeper.ClientCnxn: Session establishment request sent on localhost/127.0.0.1:2181
18/06/08 16:19:41 INFO zookeeper.ClientCnxn: Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x163891d95120b7c, negotiated timeout = 60000
18/06/08 16:19:41 DEBUG zookeeper.ZooKeeperWatcher: hconnection-0x402bba4f0x0, quorum=localhost:2181, baseZNode=/hbase Received ZooKeeper Event, type=None, state=SyncConnected, path=null
18/06/08 16:19:41 DEBUG zookeeper.ZooKeeperWatcher: hconnection-0x402bba4f-0x163891d95120b7c connected
18/06/08 16:19:41 DEBUG zookeeper.ClientCnxn: Reading reply sessionid:0x163891d95120b7c, packet:: clientPath:null serverPath:null finished:false header:: 1,3  replyHeader:: 1,8595911618,-101  request:: '/hbase/hbaseid,F  response::
18/06/08 16:19:41 INFO client.ZooKeeperRegistry: ClusterId read in ZooKeeper is null
18/06/08 16:19:41 DEBUG client.ConnectionManager$HConnectionImplementation: clusterid came back null, using default default-cluster
18/06/08 16:19:41 DEBUG ipc.AbstractRpcClient: Codec=org.apache.hadoop.hbase.codec.KeyValueCodec@44c03695, compressor=null, tcpKeepAlive=true, tcpNoDelay=true, connectTO=10000, readTO=20000, writeTO=60000, minIdleTimeBeforeClose=120000, maxRetries=0, fallbackAllowed=false, bind address=null
18/06/08 16:19:41 DEBUG zookeeper.ClientCnxn: Reading reply sessionid:0x163891d95120b7c, packet:: clientPath:null serverPath:null finished:false header:: 2,4  replyHeader:: 2,8595911618,-101  request:: '/hbase/meta-region-server,F  response::
18/06/08 16:19:41 DEBUG zookeeper.ZKUtil: hconnection-0x402bba4f-0x163891d95120b7c, quorum=localhost:2181, baseZNode=/hbase Unable to get data of znode /hbase/meta-region-server because node does not exist (not an error)
18/06/08 16:19:41 DEBUG zookeeper.ClientCnxn: Reading reply sessionid:0x163891d95120b7c, packet:: clientPath:null serverPath:null finished:false header:: 3,4  replyHeader:: 3,8595911618,-101  request:: '/hbase/meta-region-server,F  response::
18/06/08 16:19:41 DEBUG zookeeper.ZKUtil: hconnection-0x402bba4f-0x163891d95120b7c, quorum=localhost:2181, baseZNode=/hbase Unable to get data of znode /hbase/meta-region-server because node does not exist (not an error)
18/06/08 16:19:41 DEBUG zookeeper.ClientCnxn: Reading reply sessionid:0x163891d95120b7c, packet:: clientPath:null serverPath:null finished:false header:: 4,4  replyHeader:: 4,8595911618,-101  request:: '/hbase/meta-region-server,F  response::
18/06/08 16:19:41 DEBUG zookeeper.ZKUtil: hconnection-0x402bba4f-0x163891d95120b7c, quorum=localhost:2181, baseZNode=/hbase Unable to get data of znode /hbase/meta-region-server because node does not exist (not an error)
18/06/08 16:19:42 DEBUG zookeeper.ClientCnxn: Reading reply sessionid:0x163891d95120b7c, packet:: clientPath:null serverPath:null finished:false header:: 5,4  replyHeader:: 5,8595911618,-101  request:: '/hbase/meta-region-server,F  response::
18/06/08 16:19:42 DEBUG zookeeper.ZKUtil: hconnection-0x402bba4f-0x163891d95120b7c, quorum=localhost:2181, baseZNode=/hbase Unable to get data of znode /hbase/meta-region-server because node does not exist (not an error)
18/06/08 16:19:42 DEBUG zookeeper.ClientCnxn: Reading reply sessionid:0x163891d95120b7c, packet:: clientPath:null serverPath:null finished:false header:: 6,4  replyHeader:: 6,8595911622,-101  request:: '/hbase/meta-region-server,F  response::
18/06/08 16:19:42 DEBUG zookeeper.ZKUtil: hconnection-0x402bba4f-0x163891d95120b7c, quorum=localhost:2181, baseZNode=/hbase Unable to get data of znode /hbase/meta-region-server because node does not exist (not an error)
18/06/08 16:19:42 DEBUG zookeeper.ClientCnxn: Reading reply sessionid:0x163891d95120b7c, packet:: clientPath:null serverPath:null finished:false header:: 7,4  replyHeader:: 7,8595911622,-101  request:: '/hbase/meta-region-server,F  response::
18/06/08 16:19:42 DEBUG zookeeper.ZKUtil: hconnection-0x402bba4f-0x163891d95120b7c, quorum=localhost:2181, baseZNode=/hbase Unable to get data of znode /hbase/meta-region-server because node does not exist (not an error)
18/06/08 16:19:42 DEBUG zookeeper.ClientCnxn: Reading reply sessionid:0x163891d95120b7c, packet:: clientPath:null serverPath:null finished:false header:: 8,4  replyHeader:: 8,8595911622,-101  request:: '/hbase/meta-region-server,F  response::
18/06/08 16:19:42 DEBUG zookeeper.ZKUtil: hconnection-0x402bba4f-0x163891d95120b7c, quorum=localhost:2181, baseZNode=/hbase Unable to get data of znode /hbase/meta-region-server because node does not exist (not an error)
18/06/08 16:19:42 DEBUG zookeeper.ClientCnxn: Reading reply sessionid:0x163891d95120b7c, packet:: clientPath:null serverPath:null finished:false header:: 9,4  replyHeader:: 9,8595911622,-101  request:: '/hbase/meta-region-server,F  response::
18/06/08 16:19:42 DEBUG zookeeper.ZKUtil: hconnection-0x402bba4f-0x163891d95120b7c, quorum=localhost:2181, baseZNode=/hbase Unable to get data of znode /hbase/meta-region-server because node does not exist (not an error)
18/06/08 16:19:43 DEBUG zookeeper.ClientCnxn: Reading reply sessionid:0x163891d95120b7c, packet:: clientPath:null serverPath:null finished:false header:: 10,4  replyHeader:: 10,8595911622,-101  request:: '/hbase/meta-region-server,F  response::
18/06/08 16:19:43 DEBUG zookeeper.ZKUtil: hconnection-0x402bba4f-0x163891d95120b7c, quorum=localhost:2181, baseZNode=/hbase Unable to get data of znode /hbase/meta-region-server because node does not exist (not an error)
18/06/08 16:19:43 DEBUG zookeeper.ClientCnxn: Reading reply sessionid:0x163891d95120b7c, packet:: clientPath:null serverPath:null finished:false header:: 11,4  replyHeader:: 11,8595911624,-101  request&lt;/PRE&gt;</description>
    <pubDate>Sat, 09 Jun 2018 03:26:02 GMT</pubDate>
    <dc:creator>aliyesami</dc:creator>
    <dc:date>2018-06-09T03:26:02Z</dc:date>
    <item>
      <title>HBASE JAVA API issues</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HBASE-JAVA-API-issues/m-p/219176#M79392</link>
      <description>&lt;P&gt;I am running a simple HBASE JAva code to create a table but I am getting this error &lt;/P&gt;&lt;PRE&gt;.6.4.0-91/phoenix/phoenix-client.jar:/usr/hdp/2.6.4.0-91/phoenix/phoenix-server.jar://usr/hdp/2.6.4.0-91/hbase/conf/hbase-site.xml:.
18/06/08 16:19:41 INFO zookeeper.ZooKeeper: Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
18/06/08 16:19:41 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=/tmp
18/06/08 16:19:41 INFO zookeeper.ZooKeeper: Client environment:java.compiler=&amp;lt;NA&amp;gt;
18/06/08 16:19:41 INFO zookeeper.ZooKeeper: Client environment:os.name=Linux
18/06/08 16:19:41 INFO zookeeper.ZooKeeper: Client environment:os.arch=amd64
18/06/08 16:19:41 INFO zookeeper.ZooKeeper: Client environment:os.version=2.6.32-642.6.2.el6.x86_64
18/06/08 16:19:41 INFO zookeeper.ZooKeeper: Client environment:user.name=root
18/06/08 16:19:41 INFO zookeeper.ZooKeeper: Client environment:user.home=/root
18/06/08 16:19:41 INFO zookeeper.ZooKeeper: Client environment:user.dir=/root
18/06/08 16:19:41 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2181 sessionTimeout=90000 watcher=org.apache.hadoop.hbase.zookeeper.PendingWatcher@5158b42f
18/06/08 16:19:41 DEBUG zookeeper.ClientCnxn: zookeeper.disableAutoWatchReset is false
18/06/08 16:19:41 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
18/06/08 16:19:41 INFO zookeeper.ClientCnxn: Socket connection established, initiating session, client: /127.0.0.1:39668, server: localhost/127.0.0.1:2181
18/06/08 16:19:41 DEBUG zookeeper.ClientCnxn: Session establishment request sent on localhost/127.0.0.1:2181
18/06/08 16:19:41 INFO zookeeper.ClientCnxn: Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x163891d95120b7c, negotiated timeout = 60000
18/06/08 16:19:41 DEBUG zookeeper.ZooKeeperWatcher: hconnection-0x402bba4f0x0, quorum=localhost:2181, baseZNode=/hbase Received ZooKeeper Event, type=None, state=SyncConnected, path=null
18/06/08 16:19:41 DEBUG zookeeper.ZooKeeperWatcher: hconnection-0x402bba4f-0x163891d95120b7c connected
18/06/08 16:19:41 DEBUG zookeeper.ClientCnxn: Reading reply sessionid:0x163891d95120b7c, packet:: clientPath:null serverPath:null finished:false header:: 1,3  replyHeader:: 1,8595911618,-101  request:: '/hbase/hbaseid,F  response::
18/06/08 16:19:41 INFO client.ZooKeeperRegistry: ClusterId read in ZooKeeper is null
18/06/08 16:19:41 DEBUG client.ConnectionManager$HConnectionImplementation: clusterid came back null, using default default-cluster
18/06/08 16:19:41 DEBUG ipc.AbstractRpcClient: Codec=org.apache.hadoop.hbase.codec.KeyValueCodec@44c03695, compressor=null, tcpKeepAlive=true, tcpNoDelay=true, connectTO=10000, readTO=20000, writeTO=60000, minIdleTimeBeforeClose=120000, maxRetries=0, fallbackAllowed=false, bind address=null
18/06/08 16:19:41 DEBUG zookeeper.ClientCnxn: Reading reply sessionid:0x163891d95120b7c, packet:: clientPath:null serverPath:null finished:false header:: 2,4  replyHeader:: 2,8595911618,-101  request:: '/hbase/meta-region-server,F  response::
18/06/08 16:19:41 DEBUG zookeeper.ZKUtil: hconnection-0x402bba4f-0x163891d95120b7c, quorum=localhost:2181, baseZNode=/hbase Unable to get data of znode /hbase/meta-region-server because node does not exist (not an error)
18/06/08 16:19:41 DEBUG zookeeper.ClientCnxn: Reading reply sessionid:0x163891d95120b7c, packet:: clientPath:null serverPath:null finished:false header:: 3,4  replyHeader:: 3,8595911618,-101  request:: '/hbase/meta-region-server,F  response::
18/06/08 16:19:41 DEBUG zookeeper.ZKUtil: hconnection-0x402bba4f-0x163891d95120b7c, quorum=localhost:2181, baseZNode=/hbase Unable to get data of znode /hbase/meta-region-server because node does not exist (not an error)
18/06/08 16:19:41 DEBUG zookeeper.ClientCnxn: Reading reply sessionid:0x163891d95120b7c, packet:: clientPath:null serverPath:null finished:false header:: 4,4  replyHeader:: 4,8595911618,-101  request:: '/hbase/meta-region-server,F  response::
18/06/08 16:19:41 DEBUG zookeeper.ZKUtil: hconnection-0x402bba4f-0x163891d95120b7c, quorum=localhost:2181, baseZNode=/hbase Unable to get data of znode /hbase/meta-region-server because node does not exist (not an error)
18/06/08 16:19:42 DEBUG zookeeper.ClientCnxn: Reading reply sessionid:0x163891d95120b7c, packet:: clientPath:null serverPath:null finished:false header:: 5,4  replyHeader:: 5,8595911618,-101  request:: '/hbase/meta-region-server,F  response::
18/06/08 16:19:42 DEBUG zookeeper.ZKUtil: hconnection-0x402bba4f-0x163891d95120b7c, quorum=localhost:2181, baseZNode=/hbase Unable to get data of znode /hbase/meta-region-server because node does not exist (not an error)
18/06/08 16:19:42 DEBUG zookeeper.ClientCnxn: Reading reply sessionid:0x163891d95120b7c, packet:: clientPath:null serverPath:null finished:false header:: 6,4  replyHeader:: 6,8595911622,-101  request:: '/hbase/meta-region-server,F  response::
18/06/08 16:19:42 DEBUG zookeeper.ZKUtil: hconnection-0x402bba4f-0x163891d95120b7c, quorum=localhost:2181, baseZNode=/hbase Unable to get data of znode /hbase/meta-region-server because node does not exist (not an error)
18/06/08 16:19:42 DEBUG zookeeper.ClientCnxn: Reading reply sessionid:0x163891d95120b7c, packet:: clientPath:null serverPath:null finished:false header:: 7,4  replyHeader:: 7,8595911622,-101  request:: '/hbase/meta-region-server,F  response::
18/06/08 16:19:42 DEBUG zookeeper.ZKUtil: hconnection-0x402bba4f-0x163891d95120b7c, quorum=localhost:2181, baseZNode=/hbase Unable to get data of znode /hbase/meta-region-server because node does not exist (not an error)
18/06/08 16:19:42 DEBUG zookeeper.ClientCnxn: Reading reply sessionid:0x163891d95120b7c, packet:: clientPath:null serverPath:null finished:false header:: 8,4  replyHeader:: 8,8595911622,-101  request:: '/hbase/meta-region-server,F  response::
18/06/08 16:19:42 DEBUG zookeeper.ZKUtil: hconnection-0x402bba4f-0x163891d95120b7c, quorum=localhost:2181, baseZNode=/hbase Unable to get data of znode /hbase/meta-region-server because node does not exist (not an error)
18/06/08 16:19:42 DEBUG zookeeper.ClientCnxn: Reading reply sessionid:0x163891d95120b7c, packet:: clientPath:null serverPath:null finished:false header:: 9,4  replyHeader:: 9,8595911622,-101  request:: '/hbase/meta-region-server,F  response::
18/06/08 16:19:42 DEBUG zookeeper.ZKUtil: hconnection-0x402bba4f-0x163891d95120b7c, quorum=localhost:2181, baseZNode=/hbase Unable to get data of znode /hbase/meta-region-server because node does not exist (not an error)
18/06/08 16:19:43 DEBUG zookeeper.ClientCnxn: Reading reply sessionid:0x163891d95120b7c, packet:: clientPath:null serverPath:null finished:false header:: 10,4  replyHeader:: 10,8595911622,-101  request:: '/hbase/meta-region-server,F  response::
18/06/08 16:19:43 DEBUG zookeeper.ZKUtil: hconnection-0x402bba4f-0x163891d95120b7c, quorum=localhost:2181, baseZNode=/hbase Unable to get data of znode /hbase/meta-region-server because node does not exist (not an error)
18/06/08 16:19:43 DEBUG zookeeper.ClientCnxn: Reading reply sessionid:0x163891d95120b7c, packet:: clientPath:null serverPath:null finished:false header:: 11,4  replyHeader:: 11,8595911624,-101  request&lt;/PRE&gt;</description>
      <pubDate>Sat, 09 Jun 2018 03:26:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HBASE-JAVA-API-issues/m-p/219176#M79392</guid>
      <dc:creator>aliyesami</dc:creator>
      <dc:date>2018-06-09T03:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: HBASE JAVA API issues</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HBASE-JAVA-API-issues/m-p/219177#M79393</link>
      <description>&lt;P&gt;Either the zookeeper or znode is incorrect. &lt;BR /&gt;* parent znode for hdp is generally /hbase-unsecure or /hbase-secure (not /hbase)&lt;/P&gt;&lt;P&gt;* check you are giving the right zookeeper address while connecting.  &lt;BR /&gt;&lt;BR /&gt;If you are not specifying them manually, then make sure that right hbase-site.xml is in your application classpath.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jun 2018 03:27:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HBASE-JAVA-API-issues/m-p/219177#M79393</guid>
      <dc:creator>asinghal</dc:creator>
      <dc:date>2018-06-09T03:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: HBASE JAVA API issues</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HBASE-JAVA-API-issues/m-p/219178#M79394</link>
      <description>&lt;P&gt;where in this code I will specify the parent znode?  are there any examples for HBASE JAVA api ?&lt;/P&gt;&lt;P&gt;also I am specifying the hbase-site.xml in classpath  as follows :&lt;/P&gt;&lt;PRE&gt;java  -classpath /usr/hdp/2.6.4.0-91/hbase/lib/hbase-client-1.1.2.2.6.4.0-91.jar:/usr/hdp/2.6.4.0-91/phoenix/*:/usr/hdp/2.6.4.0-91/hbase/conf/hbase-site.xml:.  CreateHbaseTable
&lt;/PRE&gt;&lt;PRE&gt;[root@hadoop1 ~]# vi CreateHbaseTable.java
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.MasterNotRunningException;
import org.apache.hadoop.hbase.ZooKeeperConnectionException;
import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.util.Bytes;
public class CreateHbaseTable {
Configuration config = HBaseConfiguration.create();
public void createtable(String name,String[] colfamily) throws MasterNotRunningException,
                                               ZooKeeperConnectionException, IOException
{
HBaseAdmin admin = new HBaseAdmin(config);
HTableDescriptor des = new HTableDescriptor(Bytes.toBytes(name));
for(int i=0;i&amp;lt;colfamily.length;i++){
des.addFamily(new HColumnDescriptor(colfamily[i]));
}
if(admin.tableExists(name)){
System.out.println("Table already exist");
}
else{
admin.createTable(des);
System.out.println("Table: "+name+ " Sucessfully created");
}
}
public static void main(String args[]) throws MasterNotRunningException,
                               ZooKeeperConnectionException,IOException{
CreateHbaseTable op = new CreateHbaseTable();
String tablename = "Acadgild";
String[] familys = {"Emp_name","sal"};
op.createtable(tablename, familys);
}
}

&amp;lt;br&amp;gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 09 Jun 2018 03:56:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HBASE-JAVA-API-issues/m-p/219178#M79394</guid>
      <dc:creator>aliyesami</dc:creator>
      <dc:date>2018-06-09T03:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: HBASE JAVA API issues</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HBASE-JAVA-API-issues/m-p/219179#M79395</link>
      <description>&lt;PRE&gt;Configuration config = HBaseConfiguration.create();&lt;/PRE&gt;&lt;P&gt;Either you can add them config.set("zookeeper.znode.parent","/hbase-unsecure") and config.set("hbase.zookeeper.quorum","&amp;lt;server-name&amp;gt;) &lt;BR /&gt;Or you can directly include server hbase-site.xml in your application classpath so that HBaseConfiguration.create() will add them automatically.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jun 2018 03:57:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HBASE-JAVA-API-issues/m-p/219179#M79395</guid>
      <dc:creator>asinghal</dc:creator>
      <dc:date>2018-06-09T03:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: HBASE JAVA API issues</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HBASE-JAVA-API-issues/m-p/219180#M79396</link>
      <description>&lt;P&gt;I tried to add it but its giving compilation error. &lt;/P&gt;&lt;P&gt;I showed the command using server based hbase-site.xml. . why its not adding it?&lt;/P&gt;&lt;PRE&gt;
Configuration config = HBaseConfiguration.create();
config.set("zookeeper.znode.parent","/hbase-unsecure");&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 09 Jun 2018 04:21:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HBASE-JAVA-API-issues/m-p/219180#M79396</guid>
      <dc:creator>aliyesami</dc:creator>
      <dc:date>2018-06-09T04:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: HBASE JAVA API issues</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HBASE-JAVA-API-issues/m-p/219181#M79397</link>
      <description>&lt;P&gt;you can't keep statement outside of method or constructor except declaration, static blocks in java.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jun 2018 04:24:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HBASE-JAVA-API-issues/m-p/219181#M79397</guid>
      <dc:creator>asinghal</dc:creator>
      <dc:date>2018-06-09T04:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: HBASE JAVA API issues</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HBASE-JAVA-API-issues/m-p/219182#M79398</link>
      <description>&lt;P&gt;this code is giving me compilation error ,whats wrong? &lt;/P&gt;&lt;PRE&gt;[root@hadoop1 ~]# javac  -classpath /usr/hdp/2.6.4.0-91/hbase/lib/hbase-client-1.1.2.2.6.4.0-91.jar:/usr/hdp/2.6.4.0-91/phoenix/*:/usr/hdp/2.6.4.0-91/hbase/conf/hbase-site.xml:.  CreateHbaseTable.java
CreateHbaseTable.java:12: error: &amp;lt;identifier&amp;gt; expected
config.set("zookeeper.znode.parent","/hbase-unsecure");
          ^
CreateHbaseTable.java:12: error: illegal start of type
config.set("zookeeper.znode.parent","/hbase-unsecure");
           ^
CreateHbaseTable.java:12: error: illegal start of type
config.set("zookeeper.znode.parent","/hbase-unsecure");
                                    ^
CreateHbaseTable.java:13: error: &amp;lt;identifier&amp;gt; expected
config.set("hbase.zookeeper.quorum", "hadoop1,hadoop2");
          ^
CreateHbaseTable.java:13: error: illegal start of type
config.set("hbase.zookeeper.quorum", "hadoop1,hadoop2");
           ^
CreateHbaseTable.java:13: error: illegal start of type
config.set("hbase.zookeeper.quorum", "hadoop1,hadoop2");
&lt;/PRE&gt;&lt;PRE&gt;[root@hadoop1 ~]# more CreateHbaseTable.java
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.MasterNotRunningException;
import org.apache.hadoop.hbase.ZooKeeperConnectionException;
import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.util.Bytes;
public class CreateHbaseTable {
Configuration config = HBaseConfiguration.create();
config.set("zookeeper.znode.parent","/hbase-unsecure");
config.set("hbase.zookeeper.quorum", "hadoop1,hadoop2");
config.set("hbase.zookeeper.property.clientPort", "2181");
config.set("hbase.cluster.distributed", "true");
config.set("zookeeper.znode.parent","/hbase-unsecure");
public void createtable(String name,String[] colfamily) throws MasterNotRunningException,
                                               ZooKeeperConnectionException, IOException
{
HBaseAdmin admin = new HBaseAdmin(config);
HTableDescriptor des = new HTableDescriptor(Bytes.toBytes(name));
for(int i=0;i&amp;lt;colfamily.length;i++){
des.addFamily(new HColumnDescriptor(colfamily[i]));
}
if(admin.tableExists(name)){
System.out.println("Table already exist");
}
else{
admin.createTable(des);
System.out.println("Table: "+name+ " Sucessfully created");
}
}
public static void main(String args[]) throws MasterNotRunningException,
                               ZooKeeperConnectionException,IOException{
CreateHbaseTable op = new CreateHbaseTable();
String tablename = "Acadgild";
String[] familys = {"Emp_name","sal"};
op.createtable(tablename, familys);
}
}
You have new mail in /var/spool/mail/root

&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 09 Jun 2018 04:25:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HBASE-JAVA-API-issues/m-p/219182#M79398</guid>
      <dc:creator>aliyesami</dc:creator>
      <dc:date>2018-06-09T04:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: HBASE JAVA API issues</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HBASE-JAVA-API-issues/m-p/219183#M79399</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/10115/sahmad43.html" nodeid="10115"&gt;@Sami Ahmad&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I made some changes to your code, it should look like following to work properly:&lt;/P&gt;&lt;PRE&gt;import java.io.IOException;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.client.Admin;
import org.apache.hadoop.hbase.client.Connection;
import org.apache.hadoop.hbase.client.ConnectionFactory;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.conf.Configuration;

public class CreateHbaseTable {

        public void createtable(String name, String[] colfamily)throws Exception {
                Configuration config = HBaseConfiguration.create();
                config.set("hbase.zookeeper.quorum", "hadoop1,hadoop2");
                config.set("hbase.zookeeper.property.clientPort", "2181");
                config.set("hbase.cluster.distributed", "true");
                config.set("zookeeper.znode.parent", "/hbase-unsecure");
                HBaseAdmin admin = new HBaseAdmin(config);
                HTableDescriptor des = new HTableDescriptor(Bytes.toBytes(name));
                for (int i = 0; i &amp;lt; colfamily.length; i++) {
                        des.addFamily(new HColumnDescriptor(colfamily[i]));
                }
                if (admin.tableExists(name)) {
                        System.out.println("Table already exist");
                } else {
                        admin.createTable(des);
                        System.out.println("Table: " + name + " Sucessfully created");
                }
        }

        public static void main(String args[]) throws Exception {
                CreateHbaseTable op = new CreateHbaseTable();
                String tablename = "Acadgild";
                String[] familys = { "Emp_name", "sal" };
                op.createtable(tablename, familys);
        }
}&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Now in order to compile and run this code please do this:&lt;/P&gt;&lt;PRE&gt;# export CLASSPATH=`hbase classpath`:.
# javac CreateHbaseTable.java 
# java CreateHbaseTable

OUTPUT:
.
.
2018-06-09 00:40:18,504 INFO  [main] client.HBaseAdmin: Created Acadgild
Table: Acadgild Sucessfully created&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Additionally if you want to use Maven Based Simple HBase client then please refer to: &lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/jaysensharma/MiddlewareMagicDemos/tree/master/HDP_Ambari/HBase/HBase_Client" target="_blank"&gt;https://github.com/jaysensharma/MiddlewareMagicDemos/tree/master/HDP_Ambari/HBase/HBase_Client&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jun 2018 07:44:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HBASE-JAVA-API-issues/m-p/219183#M79399</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2018-06-09T07:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: HBASE JAVA API issues</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HBASE-JAVA-API-issues/m-p/219184#M79400</link>
      <description>&lt;P&gt;You need to add the directory containing hbase-site.xml that you want, not the file itself. This is how Java works. You specify jar files, an asterisk wildcard, or a directory.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Jun 2018 05:25:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HBASE-JAVA-API-issues/m-p/219184#M79400</guid>
      <dc:creator>elserj</dc:creator>
      <dc:date>2018-06-10T05:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: HBASE JAVA API issues</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/HBASE-JAVA-API-issues/m-p/219185#M79401</link>
      <description>awesome it worked .  thanks</description>
      <pubDate>Mon, 11 Jun 2018 22:53:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/HBASE-JAVA-API-issues/m-p/219185#M79401</guid>
      <dc:creator>aliyesami</dc:creator>
      <dc:date>2018-06-11T22:53:32Z</dc:date>
    </item>
  </channel>
</rss>

