-
Notifications
You must be signed in to change notification settings - Fork 108
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
[to #555] enable api v2 #575
Conversation
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
@@ -155,6 +156,42 @@ public boolean onStoreUnreachable(BackOffer backOffer) { | |||
return false; | |||
} | |||
|
|||
public ByteString buildRequestKey(ByteString key) { | |||
switch (conf.getApiVersion()) { |
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.
can we get the cluster version and tikv configuration from PD? so that we don't need to add one more config in the java client and the java client can automatically adjust the encode/decode methods according to the cluster it is connected to.
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.
By design, the client should not read the TiKV configuration from PD or themself. Because:
- TiKV configurations could be different from each other due to the restart process.
- TiDB use client-go, which should have the same behaviour as the client-java, however, TiDB would never use API v2 but use API v1 instead, due to they have a key prefix with
m
ort
. Thus, client-go should not read the API version from the cluster components, instead, just set the version to1
.
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #575 +/- ##
============================================
+ Coverage 34.11% 34.50% +0.38%
- Complexity 1369 1411 +42
============================================
Files 270 278 +8
Lines 17244 17342 +98
Branches 1958 1970 +12
============================================
+ Hits 5882 5983 +101
+ Misses 10752 10747 -5
- Partials 610 612 +2
Continue to review full report at Codecov.
|
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
import org.tikv.common.TiConfiguration.ApiVersion; | ||
import org.tikv.raw.RawKVClient; | ||
|
||
public class ApiVersionTest { |
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.
@pingyu PTAL on this compatible test for API v2.
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~
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
…aster' of github.com:tikv/client-java into api-v2 Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
…n api v2 Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
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.
Much better! One thing I am curious is the usage of Pair
. There are many places using it, like encodeRange
. Why not directly use the Range
type?
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
The |
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
@xuanyu66, Thanks for your review. The bot only counts LGTMs from Reviewers and higher roles, but you're still welcome to leave your comments. You are not a reviewer or committer or co-leader or leader. |
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
@zhangyangyu, Thanks for your review. The bot only counts LGTMs from Reviewers and higher roles, but you're still welcome to leave your comments. You are not a reviewer or committer or co-leader or leader. |
/auto-merge |
/merge |
/run-all-tests |
Signed-off-by: iosmanthus myosmanthustree@gmail.com
What problem does this PR solve?
AbstractRegionStoreClient
,RegionStoreClient
,LockResolverClientV4
.Issue Number: close #555 , and tracked by #582
Check List for Tests
This PR has been tested by at least one of the following methods:
Related changes