-
Notifications
You must be signed in to change notification settings - Fork 88
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
Optimize endpoint index getter and also rename some methods to be mor… #783
Optimize endpoint index getter and also rename some methods to be mor… #783
Conversation
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
@@ -330,14 +330,14 @@ func (p *Processor) addNewServicesWithWorkload(workload *workloadapi.Workload, n | |||
return nil | |||
} | |||
|
|||
log.Infof("addNewServicesWithWorkload: %v", newServices) | |||
backend_uid := p.hashName.StrToNum(workload.GetUid()) | |||
log.Infof("handleWorkloadNewBoundServices %s: %v", workload.Uid, newServices) |
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.
ditto
@@ -90,7 +90,7 @@ func (h *HashName) flushDelta(str string, num uint32) error { | |||
return err | |||
} | |||
|
|||
func (h *HashName) StrToNum(str string) uint32 { | |||
func (h *HashName) Hash(str string) uint32 { |
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.
The function name seems a bit abstract and easy to confuse.
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.
on the contrary, i think this is consistent with go hash pkg
8862597
to
830e9cf
Compare
…e readable Signed-off-by: Zhonghu Xu <xuzhonghu@huawei.com>
Signed-off-by: Zhonghu Xu <xuzhonghu@huawei.com>
Signed-off-by: Zhonghu Xu <xuzhonghu@huawei.com>
Signed-off-by: Zhonghu Xu <xuzhonghu@huawei.com>
Signed-off-by: Zhonghu Xu <xuzhonghu@huawei.com>
Signed-off-by: Zhonghu Xu <xuzhonghu@huawei.com>
Signed-off-by: Zhonghu Xu <xuzhonghu@huawei.com>
830e9cf
to
50b4405
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nlgwcy 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 |
…e readable
What type of PR is this?
/kind cleanup
/kind enhancement
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #775
Previously we iterate all the endpoint map when delete a workload. Now the index are cached in userspace
Special notes for your reviewer:
Does this PR introduce a user-facing change?: