Put wal_filter under #ifndef ROCKSDB_LITE

main
Praveen Rao 9 years ago
parent a6efefef79
commit cc4d13e0a8
  1. 2
      db/db_impl.cc
  2. 2
      db/db_test.cc
  3. 2
      include/rocksdb/options.h
  4. 4
      include/rocksdb/wal_filter.h
  5. 17
      util/options.cc

@ -1154,6 +1154,7 @@ Status DBImpl::RecoverLogFiles(const std::vector<uint64_t>& log_numbers,
} }
WriteBatchInternal::SetContents(&batch, record); WriteBatchInternal::SetContents(&batch, record);
#ifndef ROCKSDB_LITE
if (db_options_.wal_filter != nullptr) { if (db_options_.wal_filter != nullptr) {
WALFilter::WALProcessingOption walProcessingOption = WALFilter::WALProcessingOption walProcessingOption =
db_options_.wal_filter->LogRecord(batch); db_options_.wal_filter->LogRecord(batch);
@ -1173,6 +1174,7 @@ Status DBImpl::RecoverLogFiles(const std::vector<uint64_t>& log_numbers,
assert(false); //unhandled case assert(false); //unhandled case
} }
} }
#endif //ROCKSDB_LITE
// If column family was not found, it might mean that the WAL write // If column family was not found, it might mean that the WAL write
// batch references to the column family that was dropped after the // batch references to the column family that was dropped after the

@ -9887,6 +9887,7 @@ TEST_F(DBTest, PauseBackgroundWorkTest) {
ASSERT_EQ(true, done.load()); ASSERT_EQ(true, done.load());
} }
#ifndef ROCKSDB_LITE
TEST_F(DBTest, WalFilterTest) { TEST_F(DBTest, WalFilterTest) {
class TestWALFilter : public WALFilter { class TestWALFilter : public WALFilter {
private: private:
@ -10063,6 +10064,7 @@ TEST_F(DBTest, WalFilterTest) {
} }
} }
} }
#endif // ROCKSDB_LITE
// 1 Insert 2 K-V pairs into DB // 1 Insert 2 K-V pairs into DB
// 2 Call Get() for both keys - expext memtable bloom hit stat to be 2 // 2 Call Get() for both keys - expext memtable bloom hit stat to be 2

@ -1132,12 +1132,14 @@ struct DBOptions {
// Not supported in ROCKSDB_LITE mode! // Not supported in ROCKSDB_LITE mode!
std::shared_ptr<Cache> row_cache; std::shared_ptr<Cache> row_cache;
#ifndef ROCKSDB_LITE
// A filter object supplied to be invoked while processing write-ahead-logs // A filter object supplied to be invoked while processing write-ahead-logs
// (WALs) during recovery. The filter provides a way to inspect log // (WALs) during recovery. The filter provides a way to inspect log
// records, ignoring a particular record or skipping replay. // records, ignoring a particular record or skipping replay.
// The filter is invoked at startup and is invoked from a single-thread // The filter is invoked at startup and is invoked from a single-thread
// currently. // currently.
const WALFilter * wal_filter; const WALFilter * wal_filter;
#endif //ROCKSDB_LITE
}; };
// Options to control the behavior of a database (passed to DB::Open) // Options to control the behavior of a database (passed to DB::Open)

@ -9,6 +9,8 @@
#ifndef STORAGE_ROCKSDB_INCLUDE_WAL_FILTER_H_ #ifndef STORAGE_ROCKSDB_INCLUDE_WAL_FILTER_H_
#define STORAGE_ROCKSDB_INCLUDE_WAL_FILTER_H_ #define STORAGE_ROCKSDB_INCLUDE_WAL_FILTER_H_
#ifndef ROCKSDB_LITE
namespace rocksdb { namespace rocksdb {
class WriteBatch; class WriteBatch;
@ -60,4 +62,6 @@ class DefaultWALFilter : WALFilter {
} // namespace rocksdb } // namespace rocksdb
#endif // ROCKSDB_LITE
#endif // STORAGE_ROCKSDB_INCLUDE_WAL_FILTER_H_ #endif // STORAGE_ROCKSDB_INCLUDE_WAL_FILTER_H_

@ -256,8 +256,11 @@ DBOptions::DBOptions()
enable_thread_tracking(false), enable_thread_tracking(false),
delayed_write_rate(1024U * 1024U), delayed_write_rate(1024U * 1024U),
skip_stats_update_on_db_open(false), skip_stats_update_on_db_open(false),
wal_recovery_mode(WALRecoveryMode::kTolerateCorruptedTailRecords), wal_recovery_mode(WALRecoveryMode::kTolerateCorruptedTailRecords)
wal_filter(nullptr) { #ifndef ROCKSDB_LITE
,wal_filter(nullptr)
#endif // ROCKSDB_LITE
{
} }
DBOptions::DBOptions(const Options& options) DBOptions::DBOptions(const Options& options)
@ -313,8 +316,12 @@ DBOptions::DBOptions(const Options& options)
delayed_write_rate(options.delayed_write_rate), delayed_write_rate(options.delayed_write_rate),
skip_stats_update_on_db_open(options.skip_stats_update_on_db_open), skip_stats_update_on_db_open(options.skip_stats_update_on_db_open),
wal_recovery_mode(options.wal_recovery_mode), wal_recovery_mode(options.wal_recovery_mode),
row_cache(options.row_cache), row_cache(options.row_cache)
wal_filter(options.wal_filter){} #ifndef ROCKSDB_LITE
,wal_filter(options.wal_filter)
#endif // ROCKSDB_LITE
{
}
static const char* const access_hints[] = { static const char* const access_hints[] = {
"NONE", "NORMAL", "SEQUENTIAL", "WILLNEED" "NONE", "NORMAL", "SEQUENTIAL", "WILLNEED"
@ -412,8 +419,10 @@ void DBOptions::Dump(Logger* log) const {
} else { } else {
Header(log, " Options.row_cache: None"); Header(log, " Options.row_cache: None");
} }
#ifndef ROCKSDB_LITE
Header(log, " Options.wal_filter: %s", Header(log, " Options.wal_filter: %s",
wal_filter ? wal_filter->Name() : "None"); wal_filter ? wal_filter->Name() : "None");
#endif // ROCKDB_LITE
} // DBOptions::Dump } // DBOptions::Dump
void ColumnFamilyOptions::Dump(Logger* log) const { void ColumnFamilyOptions::Dump(Logger* log) const {

Loading…
Cancel
Save