Skip to content

Commit a544b44

Browse files
committed
process compact
1 parent d84e375 commit a544b44

3 files changed

Lines changed: 12 additions & 10 deletions

File tree

include/pika_conf.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,12 +357,12 @@ class PikaConf : public pstd::BaseConf {
357357

358358
bool enable_progressive_compact() {
359359
std::shared_lock l(rwlock_);
360-
return enable_progressive_compact_;
360+
return enable_auto_compact_old_sst_;
361361
}
362362

363363
int progressive_compact_interval() {
364364
std::shared_lock l(rwlock_);
365-
return progressive_compact_interval_;
365+
return auto_compact_old_sst_interval_;
366366
}
367367

368368
bool enable_auto_compact_old_sst() {
@@ -1088,7 +1088,7 @@ class PikaConf : public pstd::BaseConf {
10881088
std::string blob_compression_type_ = "none";
10891089

10901090
std::unique_ptr<PikaMeta> local_meta_;
1091-
std::shared_mutex rwlock_;
1091+
mutable std::shared_mutex rwlock_;
10921092

10931093
// Rsync Rate limiting configuration
10941094
int throttle_bytes_per_second_ = 200 << 20; // 200MB/s

src/pika_conf.cc

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -446,17 +446,19 @@ int PikaConf::Load() {
446446
}
447447

448448
// Progressive compact configuration
449-
enable_progressive_compact_ = false; // 默认关闭
449+
enable_auto_compact_old_sst_ = false; // 默认关闭
450450
std::string enable_pc;
451451
GetConfStr("enable-progressive-compact", &enable_pc);
452452
if (enable_pc == "yes") {
453-
enable_progressive_compact_ = true;
453+
enable_auto_compact_old_sst_ = true;
454454
}
455455

456-
progressive_compact_interval_ = 90; // 默认90秒
457-
GetConfInt("progressive-compact-interval", &progressive_compact_interval_);
458-
if (progressive_compact_interval_ < 1) {
459-
progressive_compact_interval_ = 90;
456+
auto_compact_old_sst_interval_ = 90; // 默认90秒
457+
int interval;
458+
GetConfInt("progressive-compact-interval", &interval);
459+
auto_compact_old_sst_interval_ = interval;
460+
if (auto_compact_old_sst_interval_ < 1) {
461+
auto_compact_old_sst_interval_ = 90;
460462
}
461463

462464
GetConfInt("max-background-flushes", &max_background_flushes_);

src/storage/src/redis.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include "src/redis.h"
77
#include <sstream>
8-
#include "rocksdb/column_family.h"
8+
#include "rocksdb/db.h"
99
#include "rocksdb/compaction_job_stats.h"
1010
#include "glog/logging.h" // 确保LOG宏可用
1111

0 commit comments

Comments
 (0)