對我而言,我使用rowfilter在HBase中搜索某些rowkeys。我想做模糊查詢,所以我使用scan和rowfilter而不是使用'Get'。但是,例如,當我有一千萬行rowkeys存儲在HBase中時,掃描結果需要非常長的時間。那麼如何提高rowfilter查詢的性能呢?如何提高HBase中的RowFilter性能?
try {
for (String uid : uidsArr) {
Scan scan = new Scan();
Filter filter1 = new RowFilter(CompareFilter.CompareOp.EQUAL, new SubstringComparator(uid));
scan.setFilter(filter1);
scan.setMaxVersions(versions);
ResultScanner scanner1 = table.getScanner(scan);
Cell[] cells;
for (Result res : scanner1) {
cells = res.rawCells();
list.addAll(getHBaseTableDataListFromCells(cells));
}
}
return list;
} catch (Exception e) {
e.printStackTrace();
}