-
Notifications
You must be signed in to change notification settings - Fork 267
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
Add interface for prefix cache indexer #657
Conversation
type PrefixCacheIndexer interface { | ||
// MatchPrefix matches the longest prefix sequence for input request (passed as input tokens) | ||
// and returns matched prefix (as tokens), remaining unmatched input request (as tokens) and pods matching the prefix | ||
MatchPrefix(inputTokens []int, model string, pods []*v1.Pod) (matchedTokes []int, unMatchedTokens []int, matchedPods []*v1.Pod) |
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.
@DwyaneShi pleas help review the routing indexer interface.
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.
@gangmuk You'd like to review this as well since you will join the indexer implementation.
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.
typo I think matchedTokes
-> matchedTokens
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 usage of unMatchedTokens
? is it better to return directly or just matched and caller could know the unMatched
automatically
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.
For hash table usecase, we only need to add unmatched tokens hence returned unmatchedtokens.
Technically caller can know unmatched tokens from returned matched tokens but it will add extra computation to figure out.
type PrefixCacheIndexer interface { | ||
// MatchPrefix matches the longest prefix sequence for input request (passed as input tokens) | ||
// and returns matched prefix (as tokens), remaining unmatched input request (as tokens) and pods matching the prefix | ||
MatchPrefix(inputTokens []int, model string, pods []*v1.Pod) (matchedTokes []int, unMatchedTokens []int, matchedPods []*v1.Pod) |
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.
typo I think matchedTokes
-> matchedTokens
* Add interface for prefix cache indexer * address review comments * refactor dir layout Signed-off-by: Varun Gupta <[email protected]>
No description provided.