JackyYangPassion commented on code in PR #2364:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2364#discussion_r1406076009


##########
hugegraph-server/hugegraph-hbase/src/main/java/org/apache/hugegraph/backend/store/hbase/HbaseSessions.java:
##########
@@ -389,9 +389,12 @@ default R scan(String table, long limit) {
 
         /**
          * Scan records by rowkey 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[] prefix) {
-            return this.scan(table, prefix, true, prefix);
+            final Scan scan = new Scan().setRowPrefixFilter(prefix);

Review Comment:
   ```java
       public Scan setRowPrefixFilter(byte[] rowPrefix) {
           if (rowPrefix == null) {
               this.setStartRow(HConstants.EMPTY_START_ROW);
               this.setStopRow(HConstants.EMPTY_END_ROW);
           } else {
               this.setStartRow(rowPrefix);
               
this.setStopRow(this.calculateTheClosestNextRowKeyForPrefix(rowPrefix));
           }
   
           return this;
       }
   ```
   
   calculateTheClosestNextRowKeyForPrefix(rowPrefix) 
   
   The core of this method accurately calculates stop row, thereby solving the 
problem of edge table query seek HFile filtering invalid key-value cells, thus 
reducing subgraph query p99.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to