diff --git a/hugegraph-server/hugegraph-hbase/src/main/java/org/apache/hugegraph/backend/store/hbase/HbaseSessions.java b/hugegraph-server/hugegraph-hbase/src/main/java/org/apache/hugegraph/backend/store/hbase/HbaseSessions.java index 06cbf9ab73..6f0bf3714a 100644 --- a/hugegraph-server/hugegraph-hbase/src/main/java/org/apache/hugegraph/backend/store/hbase/HbaseSessions.java +++ b/hugegraph-server/hugegraph-hbase/src/main/java/org/apache/hugegraph/backend/store/hbase/HbaseSessions.java @@ -415,11 +415,18 @@ default R scan(String table, Set prefixes) { /** * 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); }