简体   繁体   English

如果密钥长度不固定,如何有效扫描HBase?

[英]How to scan HBase effectively if the key length is not fixed?

The HBase table key is designed as Prefix (4bytes) |Timestamp long value (8bytes) |severial bytes (lenght is different) . HBase表键被设计为Prefix(4字节)| Timestamp长值(8字节)|几个字节(长度不同)

Now I want to scan the table using start key and end key. 现在,我想使用开始键和结束键扫描表。 prefix is fixed for a scan, start key and end key is due to timestamp. 扫描的前缀是固定的,开始键和结束键归因于时间戳。 Like scan keys between Data1|2013-05-01 10:10|* 就像Data1 | 2013-05-01 10:10 | *之间的扫描键 and Data1|2013-06-01 10:10| Data1 | 2013-06-01 10:10 | * *

How can I build the start key and end key for this? 如何为此构建开始键和结束键? It confused me that the key lenght is not fix. 令我困惑的是,关键长度没有固定。 And the start end key is not that obvious like fix length key. 并且开始结束键没有像定长键那样明显。

您可以使用一个范围,在该范围内第二个键前缀(Data1 | 2013-06-01 10:10 |)后面附加一个比任何后续值都大的值(例如两个字节的0xFF)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM