Мне нужна помощь, которая использует Java для работы с HBase, но есть проблема, я полчаса искал ответы онлайн. Но решения нет .... Надеюсь, вы поможете мне, пожалуйста.
@Before
public void init() throws Exception {
Configuration config = HBaseConfiguration.create();
// 指定zookeeper的地址
config.set("hbase.zookeeper.quorum", "192.168.220.128:2181");
config.setInt("hbase.rpc.timeout",20000);
config.setInt("hbase.client.operation.timeout",30000);
config.setInt("hbase.client.scanner.timeout.period",200000);
connection = ConnectionFactory.createConnection(config);
}
@Test
public void testCreateTable() throws Exception {
String[] cfs = new String[] { "name","age" };
Admin admin = connection.getAdmin();
if (admin.tableExists(TableName.valueOf("person"))) {
System.out.println("sorry, table already exist !");
}
HTableDescriptor hTableDescriptor = new HTableDescriptor(TableName.valueOf("people"));
Arrays.stream(cfs).forEach(cf -> {
HColumnDescriptor columnDescriptor = new HColumnDescriptor(cf);
columnDescriptor.setMaxVersions(1);
hTableDescriptor.addFamily(columnDescriptor);
});
admin.createTable(hTableDescriptor);
}
, поэтому я запускаю этот метод тестирования, и консоль запрашивает следующее:
Call exception, tries=10, retries=35, started=45479 ms ago, cancelled=false, msg=row 'person,,' on table 'hbase:meta' at region=hbase:meta,,1.1588230740, hostname=localhost,16201,1554286011145, seqNum=0

Надеюсь, мне удастся создать таблицу в Hbase
Что мне делать