标题是.我的源代码是:
package hbase;
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.client.HBaseAdmin;
import org.apache.hadoop.hbase.util.Bytes;
public class HbaseExampleClient {
public static void main(String[] args) throws IOException {
Configuration config = HBaseConfiguration.create();
config.set("hbase.zookeeper.quorum", "192.168.10.17");
config.set("hbase.zookeeper.property.clientPort", "2222");
HBaseAdmin admin = new HBaseAdmin(config);//reports an IBM_JAVA NoSuchFieldError
HTableDescriptor htd = new HTableDescriptor("test1111");
HColumnDescriptor hcd = new HColumnDescriptor("data");
htd.addFamily(hcd);
admin.createTable(htd);
byte[] tablename = htd.getName();
HTableDescriptor[] tables = admin.listTables();
if(tables.length!= 1 && Bytes.equals(tablename, tables[0].getName()))
{
throw new IOException("Failed create of table!");
}
admin.close();
} …Run Code Online (Sandbox Code Playgroud)