public static void main(String[] args) throws IOException {
System.setProperty("hadoop.home.dir", "D:\\hadoop-2.6.0-cdh5.15.0");
Configuration conf = new Configuration();
conf.set("zookeeper.znode.parent", "/hbase");
conf.set("hbase.zookeeper.quorum", "can");
conf.set("hbase.zookeeper.property.clientPort", "2181");
Connection connection =
ConnectionFactory.createConnection(conf);
Admin admin = connection.getAdmin();
String name = "hadoop:table";
String cf1 = "f1";
String cf2 = "f2";
String cf3 = "f3";
//判断表是否存在
TableName tableName = TableName.valueOf(name);
boolean b = admin.tableExists(tableName);
System.out.println(b);
//HTableDescriptor 创建表
if
hbaseAPI 针对表操作 ddl
最新推荐文章于 2023-05-04 14:41:06 发布