filterList.addFilter(new SingleColumnValueFilter(Bytes 
.toBytes("information"), Bytes.toBytes(key), 

CompareOp.EQUAL, Bytes.toBytes(column.get(key))));

filterList.addFilter(new FirstKeyOnlyFilter());

FirstKeyOnlyFilter可以提高查询的效率,如果指定了start和end的rowkey,没有添加其它过滤器则可以加上FirstKeyOnlyFilter提高查询效率

如果要使用SingleColumnValueFilter来过来列的值,则最好不要与FirstKeyOnlyFilter一起使用,如果一起使用了,则只能过滤第一列的值,其它列过滤无效。

FirstKeyOnlyFilter有好也有坏,一般指定了start和end的rowkey的话,查询效率还是可以的。

转自:http://www.58os.com/BBS/OSChinaBlog/Article-7126.html

 

相关文章:

  • 2021-09-09
  • 2021-05-25
  • 2021-10-19
  • 2021-08-15
  • 2021-06-15
  • 2021-06-23
  • 2021-12-28
  • 2021-08-08
猜你喜欢
  • 2021-06-11
  • 2022-02-12
  • 2022-12-23
  • 2021-07-25
  • 2021-07-21
  • 2022-12-23
相关资源
相似解决方案