举个例子:
Hbase的java的API接口相对比较简单,举个创建表的例子来看:
public class HbaseApiTest {
staticConfiguration conf = null;
static{
conf = HBaseConfiguration.create();
conf.set("hbase.zookeeper.quorum","132.121.127.33");
conf.set("hbase.zookeeper.property.clientPort","2181");
}
/*
* 创建表
*
* @tableName 表名
*
* @family 列族列表
*/
public static void creatTable(String tableName, String[] family)
throws Exception {
// Connection connection =ConnectionFactory.createConnection(conf);
// HBaseAdmin admin =(HBaseAdmin) connection.getAdmin();
HBaseAdmin admin = newH