forked from hugegraph/hugegraph-sync
fix HBase PrefixFilter bug (#2364)
* #2177 * #2177 * #2177 * #2177 * #2177 * #2177
This commit is contained in:
parent
197e8a00ed
commit
d376b02dc5
|
|
@ -415,11 +415,18 @@ public class HbaseSessions extends BackendSessionPool {
|
|||
|
||||
/**
|
||||
* Scan records by rowkey start and prefix from a table
|
||||
* TODO: setRowPrefixFilter deprecated since HBase 2.5.0, will be removed in 4.0.0,
|
||||
* use setStartStopRowForPrefixScan(byte[]) instead.
|
||||
*/
|
||||
default R scan(String table, byte[] startRow, boolean inclusiveStart,
|
||||
byte[] prefix) {
|
||||
Scan scan = new Scan().withStartRow(startRow, inclusiveStart)
|
||||
.setFilter(new PrefixFilter(prefix));
|
||||
final Scan scan = new Scan();
|
||||
if(startRow == prefix) {
|
||||
scan.setRowPrefixFilter(prefix);
|
||||
} else {
|
||||
scan.withStartRow(startRow, inclusiveStart)
|
||||
.setFilter(new PrefixFilter(prefix));
|
||||
}
|
||||
return this.scan(table, scan);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue