hbase如何确定一条新数据写入到哪个regionserver

2025-05-07 06:36:03
推荐回答(1个)
回答1:

HBase写记录过程中regionname查找简介:
主要是看如何进行region选择,完成按domain域的数据散列,分摊至不同region上
|-->HTable table = new HTable(config, tablename);
|-->Put put = new Put(Bytes.toBytes("test2"));
|-->put.add(Bytes.toBytes(cfs[j]), Bytes.toBytes(String.valueOf(1)), Bytes.toBytes("value_3"));
|-->table.put(put);