HBase row key design for monotonically increasing keys

后端 未结 4 1613
北荒
北荒 2021-02-14 07:11

I\'ve an HBase table where I\'m writing the row keys like:

~1
~2
~3
...
~9
~10
4条回答
  •  后悔当初
    2021-02-14 07:47

    Fixed length keys are really recommended if possible. Bytes.toBytes(Long value) can be used to get a byte array from a counter. It will sort well for positive longs less than Long.MAX_VALUE.

提交回复
热议问题