开发者

Sorted results from hbase scanner

How to retrieve hbase column 开发者_运维百科family "values" in any sorted order of the same?

like

column family      value

---------------------------------

        column:1               1

        column:3               2

        column:4               3

        column:2               4


HBase itself won't do that, instead you could retrieve the list of KeyValues using the Result.raw[1] method, put that in a List and sort it by passing your own comparator to Collections.sort[2].

  1. http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/Result.html#raw()
  2. http://download.oracle.com/javase/6/docs/api/java/util/Collections.html#sort(java.util.List, java.util.Comparator)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜