-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: add store proto #277
Conversation
proto/store.proto
Outdated
|
||
message _GetRequest { | ||
bytes key = 1; | ||
string store_id = 2; |
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.
we don't need a store_id
for client facing protos. We will need the store_name
I think but I am not sure because in the cache get/set/delete apis we don't pass the cache_name.
@cprice404 could you comment on this?
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.
That rides in a header on cache APIs. That does not mean that is what we should do here, but that's how it works there. I'd personally prefer it to be in the proto, but if Chris has other thoughts I'm open to them.
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.
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.
There were compelling reasons but they no longer exist. Putting it in the message is better in this case, and most cases.
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.
okay fff5d40
proto/store.proto
Outdated
bytes key = 1; | ||
bytes value = 2; |
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.
Following the same naming convention as our cache apis this should be:
bytes store_key = 1;
bytes store_value = 2;
But I am not sure if we want to name the value as store_value
or store_body
as we call it cache_body
in the cache apis. @cprice404 thoughts?
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.
idk where body
came from, value
makes sense to me.
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 think body
came from cache_body
in cacheclient.proto
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.
sorry, what i'm saying is that I don't know how we ultimately chose body
in the cache proto. value
makes more sense to me. And overall I do not feel compelled to make this proto match the cache proto, I'd rather just take everything we've learned and make this one the best it can be.
So we have some options: If we want to keep the naming convention as cacheclient, |
proto/store.proto
Outdated
} | ||
message Miss { } | ||
message Hit { | ||
bytes value = 1; |
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.
do we want to explicitly model other data types here while we have the chance? There has been a lot of consternation about how in the cache proto we didn't model numeric values in the proto and that forced us to do weird things with them, like requiring them to be strings and then calling increment on strings. I think that if we had to do over with again we probably would have done a oneof
for the values, and supported string/bytes/int/float as discrete types. cc: @kvcache
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.
like this? fff5d40
proto/store.proto
Outdated
message _ValueType { | ||
bytes bytes_value = 1; | ||
string string_value = 2; | ||
int64 integer_value = 3; | ||
double double_value = 4; | ||
} |
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.
message _ValueType { | |
bytes bytes_value = 1; | |
string string_value = 2; | |
int64 integer_value = 3; | |
double double_value = 4; | |
} | |
message _ValueType { | |
oneof { | |
bytes bytes_value = 1; | |
string string_value = 2; | |
int64 integer_value = 3; | |
double double_value = 4; | |
} | |
} |
proto/store.proto
Outdated
message _ValueType { | ||
oneof type { | ||
bytes bytes_value = 1; | ||
string string_value = 2; | ||
int64 integer_value = 3; | ||
double double_value = 4; | ||
} | ||
} |
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 would call this message just Value
message _Value {
oneof value {
bytes bytes_value = 1;
string string_value = 2;
int64 integer_value = 3;
double double_value = 4;
}
}
Or may be we can directly use oneof in the request and response like this:
message _SetRequest {
bytes key = 1;
oneof value {
bytes bytes_value = 2;
string string_value = 3;
int64 integer_value = 4;
double double_value = 5;
}
}
message _GetResponse {
oneof value {
bytes bytes_value = 1;
string string_value = 2;
int64 integer_value = 3;
double double_value = 4;
}
}
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.
Initially I was separating like this, but then I thought, maybe it makes more sense to define them outside since we don't want these two to have chance to diverge. What do you think?
@cprice404 , @kvcache , @anp13 and I had a meeting to talk about this. Here's the summary:
Here's the change: 7b8fdf2 |
@honeyAcorn |
@kvcache Thanks for correcting it for me! I've modified previous comment too. Now it's all good to be reviewed! It looks nice and clean now :) 7b8fdf2 |
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.
This looks good to me.
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.
New Store proto for Persistent Store