以下为我使用rowfilter过滤查询uid的代码。当数据量到达千万甚至亿级别的时候,查询效率非常低下。请问有什么解决办法?
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();
}