提交 8877b8ae 编写于 作者: W wangyi.ywq 提交者: 奏之章

remove some typo

上级 ba7f0036
......@@ -960,7 +960,6 @@ void DBImpl::ScheduleGCTTL() {
}
}
void DBImpl::DumpStats() {
ScheduleGCTTL();
TEST_SYNC_POINT("DBImpl::DumpStats:1");
#ifndef ROCKSDB_LITE
const DBPropertyInfo* cf_property_info =
......
......@@ -24,7 +24,6 @@ class DBImplGCTTL_Test : public DBTestBase {
options.ttl_scan_gap = 10;
options.ttl_extractor_factory.reset(new test::TestTtlExtractorFactory());
options.level0_file_num_compaction_trigger = 8;
options.stats_dump_period_sec = 10;
options.table_factory.reset(
new BlockBasedTableFactory(BlockBasedTableOptions()));
}
......@@ -79,7 +78,6 @@ TEST_F(DBImplGCTTL_Test, L0FileExpiredTest) {
dbfull()->Flush(FlushOptions());
}
// dbfull()->StartPeriodicWorkScheduler();
ASSERT_EQ(10, dbfull()->GetDBOptions().stats_dump_period_sec);
dbfull()->TEST_WaitForStatsDumpRun([&] { mock_env_->set_current_time(ttl); });
ASSERT_TRUE(flag);
ASSERT_EQ(L0FilesNums, mark);
......
......@@ -179,7 +179,7 @@ TEST_F(DBSSTTest, DeleteObsoleteFilesPendingOutputs) {
options.level0_file_num_compaction_trigger =
2; // trigger compaction when we have 2 files
options.max_background_flushes = 2;
options.max_background_compactions = 2;RateLimitedDelete
options.max_background_compactions = 2;
options.enable_lazy_compaction = false;
options.blob_size = -1;
......
......@@ -39,12 +39,18 @@ void PeriodicWorkScheduler::Register(DBImpl* dbi,
initial_delay.fetch_add(1) % kDefaultFlushInfoLogPeriodSec *
kMicrosInSecond,
kDefaultFlushInfoLogPeriodSec * kMicrosInSecond);
timer->Add([dbi]() { dbi->ScheduleGCTTL(); },
GetTaskName(dbi, "schedule_gc_ttl"),
initial_delay.fetch_add(1) % kDefaultScheduleGCTTLPeriodSec *
kMicrosInSecond,
kDefaultScheduleGCTTLPeriodSec * kMicrosInSecond);
}
void PeriodicWorkScheduler::Unregister(DBImpl* dbi) {
timer->Cancel(GetTaskName(dbi, "dump_st"));
timer->Cancel(GetTaskName(dbi, "pst_st"));
timer->Cancel(GetTaskName(dbi, "flush_info_log"));
timer->Cancel(GetTaskName(dbi, "schedule_gc_ttl"));
if (!timer->HasPendingTask()) {
timer->Shutdown();
}
......
......@@ -39,6 +39,7 @@ class PeriodicWorkScheduler {
// log messages leading up to the hang will eventually become visible in the
// log.
static const uint64_t kDefaultFlushInfoLogPeriodSec = 10;
static const uint64_t kDefaultScheduleGCTTLPeriodSec = 10;
protected:
std::unique_ptr<Timer> timer;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册