PragmaTwice commented on code in PR #2296:
URL: https://github.com/apache/kvrocks/pull/2296#discussion_r1597649035
##########
src/storage/storage.cc:
##########
@@ -236,11 +236,15 @@ Status Storage::CreateColumnFamilies(const
rocksdb::Options &options) {
rocksdb::ColumnFamilyOptions cf_options(options);
auto res = util::DBOpen(options, config_->db_dir);
if (res) {
- std::vector<std::string> cf_names = {kMetadataColumnFamilyName,
kZSetScoreColumnFamilyName,
- kPubSubColumnFamilyName,
kPropagateColumnFamilyName,
- kStreamColumnFamilyName,
kSearchColumnFamilyName};
+ 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());
+ }
+ }
Review Comment:
I'm thinking if we can move it into a function, like
ColumnFamilyConfigs::ListColumnFamiliesWithoutDefault();
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]