代码
put.addImmutable(Bytes.toBytes("file"),
Bytes.toBytes("xxxxx"),
new Date().getTime(),
Bytes.toBytes("UUUUUU"),
new Tag[]{new Tag((byte) 11, "IIII,IIII,IIII")});
可是为啥就加不上那????
解决
conf.set("hbase.client.default.rpc.codec", "org.apache.hadoop.hbase.codec.KeyValueCodecWithTags");
服务器端配置。也要配置。
原因
hbase.client.default.rpc.codec 默认使用的是, KeyValueCodec这个会忽略,tag 标签