-
Notifications
You must be signed in to change notification settings - Fork 253
client: split large files and rename unclear fields #1700
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
Conversation
…ural clarity Signed-off-by: Lynn <zimu_xia@126.com>
Signed-off-by: Lynn <zimu_xia@126.com>
Signed-off-by: Lynn <zimu_xia@126.com>
6594135 to
cbe4e55
Compare
MyonKeminta
left a comment
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.
I'm ok to the changes, but I think maybe we need @zyguan to give a convincing opinion about whether the refactor is proper
internal/client/conn_batch.go
Outdated
|
|
||
| // batchCommandsCh used for batch commands. | ||
| batchCommandsCh chan *batchCommandsEntry | ||
| batchCommandsConns []*batchCommandsClient |
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.
This looks not proper to be renamed ...Conns. It's not a real connection, and the word client comes from the naming of goproto. It's the client of the stream established by calling gRPC stream API.
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.
I think this batchConn is not particularly reasonable; it is embedded. I just want to say, with the conns field analogy, and then change batchCommandsClients to batchCommandsConns. Mostly, I didn't figure out what would be better to change batchConn to.
Let me just change the batchCommandsClients back.
Signed-off-by: Lynn <zimu_xia@126.com>
| } | ||
|
|
||
| // ForceRefreshAllStores get all stores from PD and refresh store cache. | ||
| func (c *RegionCache) ForceRefreshAllStores(ctx context.Context) { |
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.
Is #1686 deprecated?
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.
Yes. @guo-shaoge added it. Recently, he found that it was not used, so he hoped that I could help delete it.
Signed-off-by: Lynn <zimu_xia@126.com>
|
PTAL @zyguan |
|
/retest |
|
/retest |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: MyonKeminta, zyguan The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
This refactor focuses on improving the readability and structural clarity of the internal/client/client.go and client_batch.go files. Key changes include:
Splitting large files and isolating batch-related logic into more focused structures.
batchConnfrominternal/client/client_batch.gotointernal/client/conn_batch.goconnArrayfrominternal/client/client.gotointernal/client/conn_pool.gomonitoredConnand connMonitor from internal/client/client.gotointernal/client/conn_monitor.go`Renaming unclear struct fields, such as
connArray.v→conns, andRPCClient.conns→connPools, for better semantic clarity.