1
我想在HBase的创建表,如果它不exists.code这种方法是不工作 -HBase的表存在预期
Configuration config = HBaseConfiguration.create();
config.set("hbase.zookeeper.quorum", "indlin2741");
config.set("hbase.zookeeper.property.clientPort", "2181");
HTable hTable = new HTable(config, "test1");
System.out.println(hTable.getName());
Admin admin=ConnectionFactory.createConnection(config).getAdmin();
HTableDescriptor table = new HTableDescriptor(TableName.valueOf("test1"));
// creating column family descriptor
HColumnDescriptor family = new HColumnDescriptor("ht".getBytes());
// adding coloumn family to HTable
table.addFamily(family);
if(admin.tableExists(TableName.valueOf("test1"))){
admin.createTable(table);
}
一切工作,如果我删除tableExists方法。 一旦调用此方法,所有区域服务器都将关闭。 和波纹管错误是这样
at com.amdocs.vivo.dh.MergeSchema.Test.main(Test.java:32)
Exception in thread "main" org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed after attempts=36, exceptions:
Fri Jul 15 15:12:12 IST 2016, null, java.net.SocketTimeoutException: callTimeout=60000, callDuration=77018: row 'test1,,' on table 'hbase:meta' at region=hbase:meta,,1.1588230740, hostname=indlin2741.corp.amdocs.com,60020,1468503848155, seqNum=0
at org.apache.hadoop.hbase.client.RpcRetryingCallerWithReadReplicas.throwEnrichedException(RpcRetryingCallerWithReadReplicas.java:276)
不工作同样的问题.... –
增加蜂巢和HBase的CONF到类路径任职后 –