diff --git a/db/db_impl/db_impl.h b/db/db_impl/db_impl.h index 036b9ba72d2..39839a1880b 100644 --- a/db/db_impl/db_impl.h +++ b/db/db_impl/db_impl.h @@ -954,6 +954,24 @@ class DBImpl : public DB { VersionSet* GetVersionSet() const { return versions_.get(); } + // Wait for memtable flushed. + // If flush_memtable_id is non-null, wait until the memtable with the ID + // gets flush. Otherwise, wait until the column family don't have any + // memtable pending flush. + // resuming_from_bg_err indicates whether the caller is attempting to resume + // from background error. + Status WaitForFlushMemTable(ColumnFamilyData* cfd, + const uint64_t* flush_memtable_id = nullptr, + bool resuming_from_bg_err = false) { + return WaitForFlushMemTables({cfd}, {flush_memtable_id}, + resuming_from_bg_err); + } + // Wait for memtables to be flushed for multiple column families. + Status WaitForFlushMemTables( + const autovector& cfds, + const autovector& flush_memtable_ids, + bool resuming_from_bg_err); + #ifndef NDEBUG // Compact any files in the named level that overlap [*begin, *end] Status TEST_CompactRange(int level, const Slice* begin, const Slice* end, @@ -1678,24 +1696,6 @@ class DBImpl : public DB { Status WaitUntilFlushWouldNotStallWrites(ColumnFamilyData* cfd, bool* flush_needed); - // Wait for memtable flushed. - // If flush_memtable_id is non-null, wait until the memtable with the ID - // gets flush. Otherwise, wait until the column family don't have any - // memtable pending flush. - // resuming_from_bg_err indicates whether the caller is attempting to resume - // from background error. - Status WaitForFlushMemTable(ColumnFamilyData* cfd, - const uint64_t* flush_memtable_id = nullptr, - bool resuming_from_bg_err = false) { - return WaitForFlushMemTables({cfd}, {flush_memtable_id}, - resuming_from_bg_err); - } - // Wait for memtables to be flushed for multiple column families. - Status WaitForFlushMemTables( - const autovector& cfds, - const autovector& flush_memtable_ids, - bool resuming_from_bg_err); - inline void WaitForPendingWrites() { mutex_.AssertHeld(); TEST_SYNC_POINT("DBImpl::WaitForPendingWrites:BeforeBlock");