@@ -1888,6 +1888,14 @@ void DBImpl::MaybeScheduleFlushOrCompaction() {
1888
1888
env_->Schedule (&DBImpl::BGWorkCompaction, ca, Env::Priority::LOW, this ,
1889
1889
&DBImpl::UnscheduleCallback);
1890
1890
}
1891
+
1892
+ // TODO(guokuankuan@bytedance.com)
1893
+ // We need to find out a reasonable opportunity to emit Link Compactions
1894
+ while (false ) {
1895
+ CompactionArg* ca = new CompactionArg;
1896
+ env_->Schedule (&DBImpl::BGWorkLinkCompaction, ca, Env::Priority::LOW, this ,
1897
+ &DBImpl::UnscheduleCallback);
1898
+ }
1891
1899
}
1892
1900
1893
1901
DBImpl::BGJobLimits DBImpl::GetBGJobLimits () const {
@@ -2072,6 +2080,18 @@ void DBImpl::BGWorkCompaction(void* arg) {
2072
2080
delete prepicked_compaction;
2073
2081
}
2074
2082
2083
+ void DBImpl::BGWorkLinkCompaction (void * arg) {
2084
+ CompactionArg ca = *(reinterpret_cast <CompactionArg*>(arg));
2085
+ delete reinterpret_cast <CompactionArg*>(arg);
2086
+ IOSTATS_SET_THREAD_POOL_ID (Env::Priority::LOW);
2087
+ TEST_SYNC_POINT (" DBImpl::BGWorkLinkCompaction" );
2088
+ auto prepicked_compaction =
2089
+ static_cast <PrepickedCompaction*>(ca.prepicked_compaction );
2090
+ reinterpret_cast <DBImpl*>(ca.db )->BackgroundCallLinkCompaction (
2091
+ prepicked_compaction, Env::Priority::LOW);
2092
+ delete prepicked_compaction;
2093
+ }
2094
+
2075
2095
void DBImpl::BGWorkGarbageCollection (void * arg) {
2076
2096
CompactionArg ca = *(reinterpret_cast <CompactionArg*>(arg));
2077
2097
delete reinterpret_cast <CompactionArg*>(arg);
@@ -2408,6 +2428,14 @@ void DBImpl::BackgroundCallCompaction(PrepickedCompaction* prepicked_compaction,
2408
2428
}
2409
2429
}
2410
2430
2431
+ // TODO(guokuankuan@bytedance.com)
2432
+ void DBImpl::BackgroundCallLinkCompaction (PrepickedCompaction* prepicked_compaction,
2433
+ Env::Priority bg_thread_pri) {
2434
+ // Status s = BackgroundLinkCompaction(&made_progress, &job_context, &log_buffer,
2435
+ // prepicked_compaction);
2436
+ return ;
2437
+ }
2438
+
2411
2439
void DBImpl::BackgroundCallGarbageCollection () {
2412
2440
bool made_progress = false ;
2413
2441
JobContext job_context (next_job_id_.fetch_add (1 ), true );
@@ -2920,6 +2948,13 @@ Status DBImpl::BackgroundCompaction(bool* made_progress,
2920
2948
return status;
2921
2949
}
2922
2950
2951
+ Status DBImpl::BackgroundLinkCompaction (bool * made_progress,
2952
+ JobContext* job_context,
2953
+ LogBuffer* log_buffer,
2954
+ PrepickedCompaction* prepicked_compaction) {
2955
+ return Status::OK ();
2956
+ }
2957
+
2923
2958
Status DBImpl::BackgroundGarbageCollection (bool * made_progress,
2924
2959
JobContext* job_context,
2925
2960
LogBuffer* log_buffer) {
0 commit comments