-
Notifications
You must be signed in to change notification settings - Fork 876
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
refactor: create one type for slots set #2459 #2645
Conversation
bde7c7e
to
df4223b
Compare
options.slot_range = SlotRange{.start = static_cast<SlotId>(start.value()), | ||
.end = static_cast<SlotId>(end.value())}; |
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.
nit (not to this PR): it's parse_slot that should have been fixed instead of the static_cast 😄
for (SlotId slot = 0; slot <= SlotSet::kMaxSlot; ++slot) { | ||
if (slots.Contains(slot)) | ||
args.push_back(absl::StrCat(slot)); |
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.
nit(also not this PR): Wow, this should use slot ranges instead 😵
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 also think so, but It will change the interface of the command, so I decided not doing it now
|
||
class SlotSet { | ||
public: | ||
static constexpr SlotId kMaxSlot = 0x3FFF; |
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.
nit: maybe it's better to use the number that redis uses in decimal format? 16k something... at least it's recognizable visually
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 prefer hex format)
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.
Last question: is a header/source separation worth it? I assume this type is leaked to many units as cluster config is included in many places. The files is light on includes and functions, so likely not 🤷🏻♂️
Yes, I can not reduce number of includes and code is really light so I've decided to make it header only |
No description provided.