Skip to content

Commit c166615

Browse files
committed
Fix compile issues introduced by RocksDBLite
1 parent 588bca2 commit c166615

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

db/db_impl.cc

+10-8
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,16 @@ void DBImpl::PurgeObsoleteWALFiles() {
892892
}
893893
}
894894

895+
namespace {
896+
struct CompareLogByPointer {
897+
bool operator()(const unique_ptr<LogFile>& a, const unique_ptr<LogFile>& b) {
898+
LogFileImpl* a_impl = dynamic_cast<LogFileImpl*>(a.get());
899+
LogFileImpl* b_impl = dynamic_cast<LogFileImpl*>(b.get());
900+
return *a_impl < *b_impl;
901+
}
902+
};
903+
}
904+
895905
Status DBImpl::GetSortedWalsOfType(const std::string& path,
896906
VectorLogPtr& log_files,
897907
WalFileType log_type) {
@@ -1045,14 +1055,6 @@ Status DBImpl::ReadFirstLine(const std::string& fname,
10451055
return status;
10461056
}
10471057

1048-
struct CompareLogByPointer {
1049-
bool operator()(const unique_ptr<LogFile>& a, const unique_ptr<LogFile>& b) {
1050-
LogFileImpl* a_impl = dynamic_cast<LogFileImpl*>(a.get());
1051-
LogFileImpl* b_impl = dynamic_cast<LogFileImpl*>(b.get());
1052-
return *a_impl < *b_impl;
1053-
}
1054-
};
1055-
10561058
#endif // ROCKSDB_LITE
10571059

10581060
Status DBImpl::Recover(

db/db_impl_debug.cc

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
#include "db/db_impl.h"
1313

14+
namespace rocksdb {
15+
1416
void DBImpl::TEST_PurgeObsoleteteWAL() { PurgeObsoleteWALFiles(); }
1517

1618
uint64_t DBImpl::TEST_GetLevel0TotalSize() {
@@ -116,4 +118,5 @@ Status DBImpl::TEST_WaitForCompact() {
116118
}
117119
return bg_error_;
118120
}
121+
} // namespace rocksdb
119122
#endif // NDEBUG

0 commit comments

Comments
 (0)