-
Notifications
You must be signed in to change notification settings - Fork 75
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
Refactor keyrange #939
base: master
Are you sure you want to change the base?
Refactor keyrange #939
Conversation
@lxl66566 Convert your pr to draft since CI failed |
3ee8802
to
60f7fee
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #939 +/- ##
==========================================
- Coverage 75.55% 75.15% -0.41%
==========================================
Files 180 189 +9
Lines 26938 28541 +1603
Branches 26938 28541 +1603
==========================================
+ Hits 20353 21449 +1096
- Misses 5366 5794 +428
- Partials 1219 1298 +79 ☔ View full report in Codecov by Sentry. |
@lxl66566 Your PR is in conflict and cannot be merged. |
This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 14 days |
60f7fee
to
30c4a69
Compare
Signed-off-by: lxl66566 <[email protected]> refactor(xlineapi): KeyRange refactor Signed-off-by: lxl66566 <[email protected]> refactor(xlineapi): refactor success, test pass Signed-off-by: lxl66566 <[email protected]> refactor(xlineapi): use KeyRange instead of directly pass &[u8] to avoid clone Signed-off-by: lxl66566 <[email protected]> refactor(xlineapi): simplify all keys judgement Signed-off-by: lxl66566 <[email protected]>
Signed-off-by: lxl66566 <[email protected]>
30c4a69
to
020b290
Compare
@lxl66566 Convert your pr to draft since CI failed |
close #743
Please briefly answer these questions:
what problem are you trying to solve? (or if there's no problem, what's the motivation for this change?)
KeyRange
andInterval<BytesAffine>
, transform through &[u8]. This may make unnecessary Vec clone and memory allocation.KeyRange
is too confusing and troubling due to Bounds.what changes does this pull request make?
KeyRange
is refactored:EtcdKeyRange
andInterval<BytesAffine>
without cloning.Interval::overlap
.OneKey
andRange
is to distinguishprefix
andonekey
, which may has same form in [a, a+1).KeyRange
usage incrates/xline/src/storage/index.rs
andcrates/xline/src/storage/kv_store.rs
. By using KeyRange directly instead ofstart: &[u8], end: &[u8]
maybe better to construct from one key or all keys, and reduce the clone times.are there any non-obvious implications of these changes? (does it break compatibility with previous versions, etc)