@@ -114,7 +114,7 @@ class DBImpl : public DB {
114114 Status CompactMemTable ()
115115 EXCLUSIVE_LOCKS_REQUIRED(mutex_);
116116
117- Status WriteLevel0Table (MemTable* mem, VersionEdit* edit, Version* base)
117+ Status WriteLevel0Table (MemTable* mem, VersionEdit* edit, Version* base, uint64_t * number = NULL )
118118 EXCLUSIVE_LOCKS_REQUIRED(mutex_);
119119
120120 Status MakeRoomForWrite (bool force /* compact even if there is room? */ )
@@ -193,17 +193,24 @@ class DBImpl : public DB {
193193 std::set<uint64_t > pending_outputs_;
194194
195195 // Has a background compaction been scheduled or is running?
196- bool bg_compaction_scheduled_;
197- double bg_compaction_score_;
198- int64_t bg_schedule_id_;
196+ int bg_compaction_scheduled_;
197+ std::vector< double > bg_compaction_score_;
198+ std::vector< int64_t > bg_schedule_id_;
199199
200200 // Information for a manual compaction
201+ enum ManualCompactState {
202+ kManualCompactIdle ,
203+ kManualCompactConflict ,
204+ kManualCompactWakeup ,
205+ };
201206 struct ManualCompaction {
202207 int level;
203208 bool done;
209+ bool being_sched;
204210 const InternalKey* begin; // NULL means beginning of key range
205211 const InternalKey* end; // NULL means end of key range
206212 InternalKey tmp_storage; // Used to keep track of compaction progress
213+ int compaction_conflict; // 0 == idle, 1 == conflict, 2 == wake
207214 };
208215 ManualCompaction* manual_compaction_;
209216
0 commit comments