Skip to content

Commit

Permalink
improve: enrich command 'config get' returns (OpenAtomFoundation#1737)
Browse files Browse the repository at this point in the history
  • Loading branch information
SinuxLee authored Jul 19, 2023
1 parent a1d45bf commit ce7d807
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 52 deletions.
12 changes: 12 additions & 0 deletions include/pika_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ class PikaConf : public pstd::BaseConf {
std::shared_lock l(rwlock_);
return log_path_;
}
std::string log_level() {
std::shared_lock l(rwlock_);
return log_level_;
}
std::string db_path() {
std::shared_lock l(rwlock_);
return db_path_;
Expand Down Expand Up @@ -318,6 +322,7 @@ class PikaConf : public pstd::BaseConf {
int binlog_file_size() { return binlog_file_size_; }
PikaMeta* local_meta() { return local_meta_.get(); }
std::vector<rocksdb::CompressionType> compression_per_level();
std::string compression_all_levels() const { return compression_per_level_; };
static rocksdb::CompressionType GetCompression(const std::string& value);

// Setter
Expand Down Expand Up @@ -506,6 +511,12 @@ class PikaConf : public pstd::BaseConf {
arena_block_size_ = value;
}

void SetLogLevel(const std::string& value) {
std::lock_guard l(rwlock_);
TryPushDiffCommands("loglevel", value);
log_level_ = value;
}

pstd::Status DBSlotsSanityCheck(const std::string& db_name, const std::set<uint32_t>& slot_ids,
bool is_add);
pstd::Status AddDBSlots(const std::string& db_name, const std::set<uint32_t>& slot_ids);
Expand All @@ -528,6 +539,7 @@ class PikaConf : public pstd::BaseConf {
int thread_pool_size_ = 0;
int sync_thread_num_ = 0;
std::string log_path_;
std::string log_level_;
std::string db_path_;
std::string db_sync_path_;
int expire_dump_days_ = 3;
Expand Down
Loading

0 comments on commit ce7d807

Please sign in to comment.