imbajin commented on code in PR #2178:
URL:
https://github.com/apache/incubator-hugegraph/pull/2178#discussion_r1156962182
##########
hugegraph-hbase/src/main/java/org/apache/hugegraph/backend/store/hbase/HbaseSessions.java:
##########
@@ -418,8 +419,17 @@ default R scan(String table, Set<byte[]> prefixes) {
*/
default R scan(String table, byte[] startRow, boolean inclusiveStart,
byte[] prefix) {
- Scan scan = new Scan().withStartRow(startRow, inclusiveStart)
- .setFilter(new PrefixFilter(prefix));
+ Scan scan = new Scan();
+ if (table.equals("g_oe") || table.equals("g_ie")) {
Review Comment:
reverse the equals, and seems we could use the `Constant` vars to avoid hard
code? (search it)
```suggestion
if ("g_oe".equals(table) || "g_ie".equals(table)) {
```
@javeme @zyxxoo we could use `suggestion` for users to know the review
clearly (and could also apply it directly)

##########
hugegraph-hbase/src/main/java/org/apache/hugegraph/backend/store/hbase/HbaseSessions.java:
##########
@@ -418,8 +419,17 @@ default R scan(String table, Set<byte[]> prefixes) {
*/
default R scan(String table, byte[] startRow, boolean inclusiveStart,
byte[] prefix) {
- Scan scan = new Scan().withStartRow(startRow, inclusiveStart)
- .setFilter(new PrefixFilter(prefix));
+ Scan scan = new Scan();
+ if (table.equals("g_oe") || table.equals("g_ie")) {
+ short value = (short) (((startRow[0] << 8) | (startRow[1] &
0xFF)) +1);
+ byte[] endRow = ByteBuffer.allocate(2).putShort(value).array();
+ scan.withStartRow(startRow, inclusiveStart)
+ .withStopRow(endRow)
+ .setFilter(new PrefixFilter(prefix));
+ } else {
+ scan.withStartRow(startRow, inclusiveStart)
+ .setFilter(new PrefixFilter(prefix));
Review Comment:
use one line if ≤ 100
--
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]