-
Notifications
You must be signed in to change notification settings - Fork 562
Refactor Column Family Handling #2296
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
# Conflicts: # src/server/server.cc
@@ -1334,11 +1334,19 @@ Status SlotMigrator::migrateIncrementalDataByRawKV(uint64_t end_seq, BatchSender | |||
break; | |||
} | |||
case engine::WALItem::Type::kTypePut: { | |||
if (item.column_family_id > kMaxColumnFamilyID) { |
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 avoid get and put default CF
I don't think shared_ptr is useful here. Just put the ownership to the storage class. |
src/storage/storage.cc
Outdated
std::vector<std::string> cf_names_except_default; | ||
const auto &all_column_family = ColumnFamilyConfigs::ListAllColumnFamily(); | ||
for (const auto &cf : all_column_family) { | ||
if (cf.Name() != rocksdb::kDefaultColumnFamilyName) { | ||
cf_names_except_default.emplace_back(cf.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.
all_column_family | transform([](..){ name }) | remove_if([](..){ v != default; })
You can use range-v3 here.
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.
Anyway the logic is just same here...
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'm thinking if we can move it into a function, like ColumnFamilyConfigs::ListColumnFamiliesWithoutDefault();
ac845e5
to
7451082
Compare
7451082
to
8869ace
Compare
8869ace
to
0f332ae
Compare
5e976f6
to
d0c9b19
Compare
d0c9b19
to
dbf7d7b
Compare
|
@git-hulk @PragmaTwice Would you mind take a look? |
@mapleFU Sure, will take a look today. |
TBD: should we add a global CF manager with
std::shared_ptr
?