Skip to content

Commit

Permalink
change
Browse files Browse the repository at this point in the history
  • Loading branch information
QlQlqiqi committed Sep 20, 2024
1 parent af1994c commit 9d1044b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
11 changes: 3 additions & 8 deletions src/pika_conf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ int PikaConf::Load() {
max_subcompactions_ = 1;
}

GetConfInt("compact-every-num-of-files", &compact_every_num_of_files_);
GetConfInt("compact-every-num-of-files", &compact_every_num_of_files_);
if (compact_every_num_of_files_ < 10) {
compact_every_num_of_files_ = 10;
}
Expand Down Expand Up @@ -449,11 +449,6 @@ int PikaConf::Load() {
max_write_buffer_num_ = 2; // 1 for immutable memtable, 1 for mutable memtable
}

GetConfInt("min-write-buffer-number-to-merge", &min_write_buffer_number_to_merge_);
if (min_write_buffer_number_to_merge_ < 1) {
min_write_buffer_number_to_merge_ = 1; // 1 for immutable memtable to merge
}

// max_client_response_size
GetConfInt64Human("max-client-response-size", &max_client_response_size_);
if (max_client_response_size_ <= 0) {
Expand Down Expand Up @@ -861,9 +856,9 @@ int PikaConf::ConfigRewrite() {

std::string cs_;
SetConfStr("compaction-strategy", cs_);
if (cs_ == "full_compact") {
if (cs_ == "full-compact") {
compaction_strategy_ = FullCompact;
} else if (cs_ == "obd_compact") {
} else if (cs_ == "obd-compact") {
compaction_strategy_ = OldestOrBestDeleteRatioSstCompact;
} else {
compaction_strategy_ = FullCompact;
Expand Down
10 changes: 7 additions & 3 deletions src/storage/src/redis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ Status Redis::Open(const StorageOptions& storage_options, const std::string& db_
auto my_factory = std::make_shared<MyTablePropertiesCollectorFactory>();
rocksdb::Options ops(storage_options.options);
ops.create_missing_column_families = true;
if (storage_options.enable_db_statistics) {
db_statistics_ = rocksdb::CreateDBStatistics();
db_statistics_->set_stats_level(static_cast<rocksdb::StatsLevel>(storage_options.db_statistics_level));
ops.statistics = db_statistics_;
}
ops.table_properties_collector_factories.emplace_back(my_factory);

/*
Expand Down Expand Up @@ -330,8 +335,7 @@ void SelectColumnFamilyHandles(const DataType& option_type, const ColumnFamilyTy
}
break;
case DataType::kAll:
enum ColumnFamilyIndex s;
for (s = kMetaCF; s <= kStreamsDataCF; s = (ColumnFamilyIndex)(s + 1)) {
for (auto s = kMetaCF; s <= kStreamsDataCF; s = static_cast<ColumnFamilyIndex>(s + 1)) {
handleIdxVec.push_back(s);
}
break;
Expand Down Expand Up @@ -376,7 +380,7 @@ Status Redis::LongestNotCompactiontSstCompact(const DataType& option_type, std::
// The main goal of compaction was reclaimed the disk space and removed
// the tombstone. It seems that compaction scheduler was unnecessary here when
// the live files was too few, Hard code to 1 here.
if (props.size() < 1) {
if (props.size() <= 1) {
// LOG(WARNING) << "LongestNotCompactiontSstCompact " << handles_[idx]->GetName() << " only one file";
if (compact_result_vec) {
compact_result_vec->push_back(Status::OK());
Expand Down

0 comments on commit 9d1044b

Please sign in to comment.