-
Notifications
You must be signed in to change notification settings - Fork 151
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
client: perf/WhereCache #366
base: main
Are you sure you want to change the base?
Conversation
e738fc6
to
436255e
Compare
Signed-off-by: Yan Zhu <hackzhuyan@gmail.com>
78d5c25
to
33fa6b4
Compare
33fa6b4
to
dd8eec3
Compare
Seems generally the right thing to do... Most (all?) uses of WhereCache() already have a model that the predicate uses. |
Emm, I found it difficult to get table information from the predicate callback function since |
78d5ea5
to
754b46b
Compare
modelgen/table.go
Outdated
@@ -246,6 +246,9 @@ type {{ index . "StructName" }} struct { | |||
{{ end }} | |||
{{ template "extraFields" . }} | |||
} | |||
func (a *{{ index . "StructName" }}) Table() 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.
@halfcrazy The Table
method clashes with the ovn sbdb RBAC_Permission table column
https://github.com/ovn-org/ovn/blob/686caaf66d5be811c655ea2938b082564d5f5f75/ovn-sb.ovsschema#L383
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.
Oops, Any suggestions for this method name?
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 can't come up with a good way to future proof this and I am not sure if it is even worth it, given that solving a potential clash would just require a new modelgen along with the libovsdb bump. This might become more meaningful if we ever get past v1.0.0 and I guess we shall decide then which kind of version step we would need to support new schemas we never knew about. Let me know if you think any different.
So how does SchemaTable
sound?
Using an uppercase unicode first letter that is not valid for an OVSDB id per the RFC is another option, but I don't think that's idiomatic and I have never seen it done.
@dcbw do you have any other ideas?
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.
Update, rename to TableName
A getter-style func name? GetTableName() like I proposed in issue #365
import "github.com/ovn-org/libovsdb/model"
const RBACPermissionTable = "RBAC_Permission"
// RBACPermission defines an object in RBAC_Permission table
type RBACPermission struct {
UUID string `ovsdb:"_uuid"`
Authorization []string `ovsdb:"authorization"`
InsertDelete bool `ovsdb:"insert_delete"`
Table string `ovsdb:"table"`
Update []string `ovsdb:"update"`
}
func (a *RBACPermission) GetTableName() string {
return RBACPermissionTable
}
func (a *RBACPermission) GetUUID() string {
return a.UUID
}
...
5e3aade
to
60fa694
Compare
Signed-off-by: Yan Zhu <hackzhuyan@gmail.com>
https://github.com/ovn-org/ovn/blob/686caaf66d5be811c655ea2938b082564d5f5f75/ovn-sb.ovsschema#L383 Signed-off-by: Yan Zhu <hackzhuyan@gmail.com>
60fa694
to
da639d7
Compare
Pull Request Test Coverage Report for Build 6441663142Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Fix #365