-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(tiering): Serialized map #5896
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
Conversation
Signed-off-by: Vladislav Oleshko <[email protected]>
18581a5
to
74bff56
Compare
Signed-off-by: Vladislav Oleshko <[email protected]>
namespace dfly::tiering { | ||
|
||
SerializedMap::Iterator& SerializedMap::Iterator::operator++() { | ||
slice_.remove_prefix(8 + key_.size() + value_.size()); |
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.
please add constexpr for 8
return; | ||
|
||
uint32_t key_len = absl::little_endian::Load32(slice_.data()); | ||
uint32_t value_len = absl::little_endian::Load32(slice_.data() + 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.
please give name to 4
Signed-off-by: Vladislav <[email protected]>
|
||
size_t SerializedMap::SerializeSize(Input input) { | ||
size_t out = 4; // 4 byte number of entries | ||
size_t out = kLenBytes; // number of entries |
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.
four * two or even better four times two sounds like math poetry 🤣
You'll notice it has the same interface as #5889.
Doesn't have to be perfect or efficient, it's the first version of it. Just to exist and not be too much code at once