-
Notifications
You must be signed in to change notification settings - Fork 521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix HBase PrefixFilter bug #2364
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution
...er/hugegraph-hbase/src/main/java/org/apache/hugegraph/backend/store/hbase/HbaseSessions.java
Outdated
Show resolved
Hide resolved
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2364 +/- ##
============================================
- Coverage 65.88% 65.87% -0.02%
Complexity 826 826
============================================
Files 507 507
Lines 42073 42076 +3
Branches 5831 5832 +1
============================================
- Hits 27720 27716 -4
- Misses 11595 11608 +13
+ Partials 2758 2752 -6 ☔ View full report in Codecov by Sentry. |
*/ | ||
default R scan(String table, byte[] prefix) { | ||
return this.scan(table, prefix, true, prefix); | ||
final Scan scan = new Scan().setRowPrefixFilter(prefix); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
calculateTheClosestNextRowKeyForPrefix
calculateTheClosestNextRowKeyForPrefix()
doesn't include for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setRowPrefixFilter
will call calculateTheClosestNextRowKeyForPrefix
method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some ci error need to fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ci-cassandra failure is not related to this PR. log
|
Purpose of the PR
Main Changes
Verifying these changes
Does this PR potentially affect the following parts?
Documentation Status
Doc - TODO
Doc - Done
Doc - No Need