-
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
planner: refactor some code of cross-db binding #58424
Conversation
Hi @qw4990. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #58424 +/- ##
================================================
+ Coverage 73.5693% 73.6300% +0.0607%
================================================
Files 1680 1681 +1
Lines 463726 463857 +131
================================================
+ Hits 341160 341538 +378
+ Misses 101733 101563 -170
+ Partials 20833 20756 -77
Flags with carried forward coverage won't be shown. Click here to find out more.
|
type digestBiMapImpl struct { | ||
mu sync.RWMutex | ||
noDBDigest2SQLDigest map[string][]string // noDBDigest --> sqlDigests | ||
sqlDigest2noDBDigest map[string]string // sqlDigest --> noDBDigest |
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.
sqlDigest2noDBDigest's value can use the unique to reduce memory
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.
OK I'll update here later, I have a few more refactoring PRs based on this, after merging them all I'll update here.
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.
unique handle seems interesting
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.
Except unique
, I LGTM all the others
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.
rest LGTM
type digestBiMapImpl struct { | ||
mu sync.RWMutex | ||
noDBDigest2SQLDigest map[string][]string // noDBDigest --> sqlDigests | ||
sqlDigest2noDBDigest map[string]string // sqlDigest --> noDBDigest |
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.
unique handle seems interesting
} | ||
} | ||
|
||
func (b *digestBiMapImpl) Add(noDBDigest, sqlDigest string) { |
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.
exported func should have some comments
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.
added
return b.sqlDigest2noDBDigest[sqlDigest] | ||
} | ||
|
||
func (b *digestBiMapImpl) Copy() digestBiMap { |
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 the case of cp a map here?
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.
When we load new bindings, we'll copy the old binding cache and then insert new records into it and then replace it with the old one.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AilinKid, hawkingrei The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
What problem does this PR solve?
Issue Number: ref #51347
Problem Summary: planner: refactor some code of cross-db binding
What changed and how does it work?
planner: refactor some code of cross-db binding
NO logical change, just refactor.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.