1.rowkey以某个内容开头
Filter filtet = new PrefixFilter("ooo".getBytes());
2.rowkey字符串包含方式
Filter filter = new RowFilter(CompareOp.EQUAL,new SubstringComparator("xxx"));
3.rowkey匹配正则方式
Filter filter2 = new RowFilter(CompareFilter.CompareOp.EQUAL,new RegexStringComparator(".*5$"));
4.如果包含多个filter,可以类似Mongodb的查询方式进行添加
FilterList fl = new FilterList(Operator.MUST_PASS_ONE); fl.addFilter(filter); scan.setFilter(fl);
时间: 2024-10-04 17:39:38