Skip to content

Commit 7451082

Browse files
committed
minor fixes
1 parent 1bf6c98 commit 7451082

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/server/server.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ Status Server::Start() {
195195
auto now_hours = util::GetTimeStamp<std::chrono::hours>();
196196
if (now_hours >= config_->compaction_checker_range.start &&
197197
now_hours <= config_->compaction_checker_range.stop) {
198-
auto column_family_list = engine::ColumnFamilyConfigs::ListAllColumnFamily();
198+
const auto &column_family_list = engine::ColumnFamilyConfigs::ListAllColumnFamily();
199199
for (auto &column_family : column_family_list) {
200200
compaction_checker.PickCompactionFilesForCf(column_family);
201201
}

src/storage/compaction_checker.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void CompactionChecker::CompactPropagateAndPubSubFiles() {
3030
rocksdb::CompactRangeOptions compact_opts;
3131
compact_opts.change_level = true;
3232
for (const auto &cf :
33-
{engine::ColumnFamilyConfigs::PubSubColumnFamily(), engine::ColumnFamilyConfigs::PubSubColumnFamily()}) {
33+
{engine::ColumnFamilyConfigs::PubSubColumnFamily(), engine::ColumnFamilyConfigs::PropagateColumnFamily()}) {
3434
LOG(INFO) << "[compaction checker] Start the compact the column family: " << cf.Name();
3535
auto cf_handle = storage_->GetCFHandle(cf.Id());
3636
auto s = storage_->GetDB()->CompactRange(compact_opts, cf_handle, nullptr, nullptr);

src/storage/storage.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ class ColumnFamilyConfigs {
183183
}
184184

185185
/// ListAllColumnFamily returns all column families in kvrocks.
186-
static std::vector<ColumnFamilyConfig> ListAllColumnFamily() {
186+
static const std::vector<ColumnFamilyConfig> &ListAllColumnFamily() {
187187
// Caution: don't change the order of column family, or the handle will be mismatched
188188
std::vector<ColumnFamilyConfig> all_cfs = {
189189
PrimarySubkeyColumnFamily(), MetadataColumnFamily(), SecondarySubkeyColumnFamily(), PubSubColumnFamily(),
@@ -251,8 +251,7 @@ class Storage {
251251
rocksdb::DB *GetDB();
252252
bool IsClosing() const { return db_closing_; }
253253
std::string GetName() const { return config_->db_name; }
254-
/// Get kvrocks' ColumnFamily in by name
255-
/// If we cannot recognize the name, we will return the default ColumnFamily
254+
/// Get the column family handle by the column family id.
256255
rocksdb::ColumnFamilyHandle *GetCFHandle(ColumnFamilyID id);
257256
std::vector<rocksdb::ColumnFamilyHandle *> *GetCFHandles() { return &cf_handles_; }
258257
LockManager *GetLockManager() { return &lock_mgr_; }

0 commit comments

Comments
 (0)