从hbase扫描仪分类结果 [英] Sorted results from hbase scanner
问题描述
如何检索hbase列族中的值以任意排序顺序相同?
像列家族 值
---------------------------------
      栏目:1 1
栏目:3 2
栏目:4 3
栏目:2 4
HBase本身不会这样做,相反,您可以使用Result.raw检索KeyValues列表[1]方法,将它放在一个List中,并通过将自己的比较器传递给Collections.sort [2]来对其进行排序。
$ b
- http://hbase.apache.org/apidocs /org/apache/hadoop/hbase/client/Result.html#raw()
- http://download.oracle.com/javase/6/docs/api/java/util/ Collections.html#sort(java.util.List ,java.util.Comparator)
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].
- http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/Result.html#raw()
- http://download.oracle.com/javase/6/docs/api/java/util/Collections.html#sort(java.util.List, java.util.Comparator)
这篇关于从hbase扫描仪分类结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!