-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
store/tikv: move region_* into package store/tikv/region #25205
Conversation
bd54680
to
fbd3f10
Compare
Signed-off-by: shirly <AndreMouche@126.com>
Signed-off-by: shirly <AndreMouche@126.com>
Signed-off-by: shirly <AndreMouche@126.com>
Signed-off-by: shirly <AndreMouche@126.com>
Signed-off-by: shirly <AndreMouche@126.com>
/run-all-tests |
store/tikv/region.go
Outdated
// RPCContext contains data that is needed to send RPC to a region. | ||
type RPCContext = region.RPCContext | ||
|
||
// RPCCanceller is rpc send cancelFunc collector. | ||
type RPCCanceller = region.RPCCanceller | ||
|
||
// RegionVerID is a unique ID that can identify a Region at a specific version. | ||
type RegionVerID = region.VerID | ||
|
||
// RegionCache caches Regions loaded from PD. | ||
type RegionCache = region.Cache | ||
|
||
// KeyLocation is the region and range that a key is located. | ||
type KeyLocation = region.KeyLocation | ||
|
||
// RPCCancellerCtxKey is context key attach rpc send cancelFunc collector to ctx. | ||
type RPCCancellerCtxKey = region.RPCCancellerCtxKey | ||
|
||
// RegionRequestSender sends KV/Cop requests to tikv server. It handles network | ||
// errors and some region errors internally. | ||
// | ||
// Typically, a KV/Cop request is bind to a region, all keys that are involved | ||
// in the request should be located in the region. | ||
// The sending process begins with looking for the address of leader store's | ||
// address of the target region from cache, and the request is then sent to the | ||
// destination tikv server over TCP connection. | ||
// If region is updated, can be caused by leader transfer, region split, region | ||
// merge, or region balance, tikv server may not able to process request and | ||
// send back a RegionError. | ||
// RegionRequestSender takes care of errors that does not relevant to region | ||
// range, such as 'I/O timeout', 'NotLeader', and 'ServerIsBusy'. For other | ||
// errors, since region range have changed, the request may need to split, so we | ||
// simply return the error to caller. | ||
type RegionRequestSender = region.RequestSender | ||
|
||
// StoreSelectorOption configures storeSelectorOp. | ||
type StoreSelectorOption = region.StoreSelectorOption | ||
|
||
// RegionRequestRuntimeStats records the runtime stats of send region requests. | ||
type RegionRequestRuntimeStats = region.RequestRuntimeStats | ||
|
||
// RPCRuntimeStats indicates the RPC request count and consume time. | ||
type RPCRuntimeStats = region.RPCRuntimeStats | ||
|
||
// CodecPDClient wraps a PD Client to decode the encoded keys in region meta. | ||
type CodecPDClient = region.CodecPDClient |
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.
What's the reason for reexporting these types?
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.
Since we do not want the client to care about the sub-packages
Signed-off-by: shirly <AndreMouche@126.com>
Signed-off-by: shirly <AndreMouche@126.com>
Signed-off-by: shirly <AndreMouche@126.com>
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: eb04de0
|
/run-unit-test |
/run-integration-common-test |
/run-unit-test |
Signed-off-by: AndreMouche
What problem does this PR solve?
This PR moves tikv/region_*.go into package
store/tikv/region
Part of #22513
Check List
Tests
Release note