You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by y_...@tsmc.com on 2009/12/08 09:55:52 UTC
Create Table
Hi there,
I've been trying to create HBase table by java code.
Using HBase shell, I can see the table was created after running following
codes,
but there's exception raised.
I don't know why it raised such exception in HBase0.20.2; these code run
well in HBase0.20.0.
There are 3 region servers in my cluster; I can see these status correctly
in http://ooxx:60010/master.jsp.
(hadoop dfs running well too),(3 ZooKeeper quorum resides in the region
server machine)
By the wat, any steps that I can confirm my HBase is running well without
any problems?
Thanks
public static void CreatHBaseTable(String TableName,String ColumnFamily){
HBaseAdmin hbaseAdmin;
try {
hbaseAdmin = new HBaseAdmin(config);
HColumnDescriptor column = new
HColumnDescriptor(ColumnFamily);
//table descriptor
HTableDescriptor table = new HTableDescriptor(TableName);
//add column into table
table.addFamily(column);
hbaseAdmin.createTable(table);
} catch (MasterNotRunningException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("create "+TableName +" ok");
}
09/12/08 16:09:49 INFO zookeeper.ClientCnxn: Server connection successful
Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
at $Proxy1.getRegionInfo(Unknown Source)
at
org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRootRegion(HConnectionManager.java:874)
at
org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRegion(HConnectionManager.java:515)
at
org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRegion(HConnectionManager.java:491)
at
org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRegionInMeta(HConnectionManager.java:565)
at
org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRegion(HConnectionManager.java:524)
at
org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRegion(HConnectionManager.java:491)
at
org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRegionInMeta(HConnectionManager.java:565)
at
org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRegion(HConnectionManager.java:528)
at
org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRegion(HConnectionManager.java:491)
at
org.apache.hadoop.hbase.client.HBaseAdmin.createTable(HBaseAdmin.java:169)
at ClientMain.CreatHBaseTable(ClientMain.java:797)
at ClientMain.main(ClientMain.java:65)
Caused by: org.apache.hadoop.ipc.RemoteException: java.io.IOException:
java.lang.NullPointerException
at java.lang.Class.searchMethods(Class.java:2646)
at java.lang.Class.getMethod0(Class.java:2670)
at java.lang.Class.getMethod(Class.java:1603)
at
org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:643)
at
org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:915)
at org.apache.hadoop.hbase.ipc.HBaseClient.call(HBaseClient.java:723)
at
org.apache.hadoop.hbase.ipc.HBaseRPC$Invoker.invoke(HBaseRPC.java:328)
... 13 more
---------------------------------------------------------------------------
TSMC PROPERTY
This email communication (and any attachments) is proprietary information
for the sole use of its
intended recipient. Any unauthorized review, use or distribution by anyone
other than the intended
recipient is strictly prohibited. If you are not the intended recipient,
please notify the sender by
replying to this email, and then delete this email and any copies of it
immediately. Thank you.
---------------------------------------------------------------------------
Re: Create Table
Posted by Tatsuya Kawano <ta...@snowcocoa.info>.
Hi,
You probably have different versions of hbase-0.20.x.jar files on the
server and client sides. So try to have the same 0.20.2 on the both
sides.
Thanks,
--
河野 達也
Tatsuya Kawano (Mr.)
Tokyo, Japan
On Tue, Dec 8, 2009 at 5:55 PM, <y_...@tsmc.com> wrote:
>
> Hi there,
>
> I've been trying to create HBase table by java code.
> Using HBase shell, I can see the table was created after running following
> codes,
> but there's exception raised.
> I don't know why it raised such exception in HBase0.20.2; these code run
> well in HBase0.20.0.
>
> There are 3 region servers in my cluster; I can see these status correctly
> in http://ooxx:60010/master.jsp.
> (hadoop dfs running well too),(3 ZooKeeper quorum resides in the region
> server machine)
> By the wat, any steps that I can confirm my HBase is running well without
> any problems?
> Thanks
>
> public static void CreatHBaseTable(String TableName,String ColumnFamily){
> HBaseAdmin hbaseAdmin;
> try {
> hbaseAdmin = new HBaseAdmin(config);
>
> HColumnDescriptor column = new
> HColumnDescriptor(ColumnFamily);
> //table descriptor
> HTableDescriptor table = new HTableDescriptor(TableName);
> //add column into table
> table.addFamily(column);
> hbaseAdmin.createTable(table);
> } catch (MasterNotRunningException e1) {
> // TODO Auto-generated catch block
> e1.printStackTrace();
> } catch (IOException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
>
> System.out.println("create "+TableName +" ok");
>
> }
>
>
>
> 09/12/08 16:09:49 INFO zookeeper.ClientCnxn: Server connection successful
> Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
> at $Proxy1.getRegionInfo(Unknown Source)
> at
> org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRootRegion(HConnectionManager.java:874)
> at
> org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRegion(HConnectionManager.java:515)
> at
> org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRegion(HConnectionManager.java:491)
> at
> org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRegionInMeta(HConnectionManager.java:565)
> at
> org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRegion(HConnectionManager.java:524)
> at
> org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRegion(HConnectionManager.java:491)
> at
> org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRegionInMeta(HConnectionManager.java:565)
> at
> org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRegion(HConnectionManager.java:528)
> at
> org.apache.hadoop.hbase.client.HConnectionManager$TableServers.locateRegion(HConnectionManager.java:491)
> at
> org.apache.hadoop.hbase.client.HBaseAdmin.createTable(HBaseAdmin.java:169)
> at ClientMain.CreatHBaseTable(ClientMain.java:797)
> at ClientMain.main(ClientMain.java:65)
> Caused by: org.apache.hadoop.ipc.RemoteException: java.io.IOException:
> java.lang.NullPointerException
> at java.lang.Class.searchMethods(Class.java:2646)
> at java.lang.Class.getMethod0(Class.java:2670)
> at java.lang.Class.getMethod(Class.java:1603)
> at
> org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:643)
> at
> org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:915)
>
> at org.apache.hadoop.hbase.ipc.HBaseClient.call(HBaseClient.java:723)
> at
> org.apache.hadoop.hbase.ipc.HBaseRPC$Invoker.invoke(HBaseRPC.java:328)
> ... 13 more
> ---------------------------------------------------------------------------
> TSMC PROPERTY
> This email communication (and any attachments) is proprietary information
> for the sole use of its
> intended recipient. Any unauthorized review, use or distribution by anyone
> other than the intended
> recipient is strictly prohibited. If you are not the intended recipient,
> please notify the sender by
> replying to this email, and then delete this email and any copies of it
> immediately. Thank you.
> ---------------------------------------------------------------------------
>
>
>