-
Notifications
You must be signed in to change notification settings - Fork 404
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
proposal of yurthub cache refactoring #897
Conversation
@Congrool: GitHub didn't allow me to assign the following users: your_reviewer. Note that only openyurtio members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
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/test-infra repository. |
a523c41
to
606c134
Compare
@Congrool Maybe we should also consider the interface for reading objects from yurthub cache? |
@rambohe-ch Currently we have Get/List/ListKeys only for reading objects in diskStorage. In the case of Pool-Coordiantor, the read request will be send to the APIServer in pool-coordinator, so it does not need to use the read interface to read object from cache directly. The problem i can find is that the function of List is so weak for using. // List will retrieve all contents whose keys have the prefix of rootKey.
// If rootKey is empty, ErrKeyIsEmpty will be returned.
// If the rootKey does not exist in the store, ErrStorageNotFound will be returned.
// If the rootKey exists in the store but no keys has the prefix of rootKey,
// an empty content slice will be returned.
List(rootKey Key) ([][]byte, error) We can see that List only has rootKey as its parameter, which means it cannot list objects with selector. Thus, we can only support one kind of selector for each resource per component as described in #265 . It will be a problem if one component need to list the same resource with different selectors. But currently, we haven't encountered such a component. We can do this enhancement when we have to be faced with it. |
@Congrool ok, the conclusion is that pool-coordinator will not implement Get/List/ListKeys funcs for Storage interface because yurthub read from kube-apiserver of pool-coordinator directly. |
need revision |
@qclc: changing LGTM is restricted to collaborators In response to this:
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/test-infra repository. |
d386889
to
1547028
Compare
revised according to the newest implementation |
Codecov Report
@@ Coverage Diff @@
## master #897 +/- ##
=========================================
Coverage ? 49.45%
=========================================
Files ? 96
Lines ? 13054
Branches ? 0
=========================================
Hits ? 6456
Misses ? 6061
Partials ? 537
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@Congrool how about the definition of |
1547028
to
5a61ee6
Compare
The definition of Key is like: type Key interface {
Key() string
}
type KeyBuildInfo struct {
Component string
Namespace string
Name string
Resources string
Group string
Version string
} I'll update it in this proposal. |
5a61ee6
to
56a99e7
Compare
Signed-off-by: Congrool <chpzhangyifei@zju.edu.cn>
56a99e7
to
35ec067
Compare
proposal is updated with definition of Key and new interface names |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Congrool, rambohe-ch 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 |
What type of PR is this?
/kind documentation
/kind design
/sig storage
What this PR does / why we need it:
When implementing the feature of pool-coordinator, I encountered serval problems to be solved first. So, it is this pr. Details are in the proposal.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
other Note