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

@ -9887,6 +9887,7 @@ TEST_F(DBTest, PauseBackgroundWorkTest) {
ASSERT_EQ(true, done.load());
}
#ifndef ROCKSDB_LITE
TEST_F(DBTest, WalFilterTest) {
class TestWALFilter : public WALFilter {
private:
@ -10063,6 +10064,7 @@ TEST_F(DBTest, WalFilterTest) {
}
}
}
#endif // ROCKSDB_LITE
// 1 Insert 2 K-V pairs into DB
// 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!
std::shared_ptr<Cache> row_cache;
#ifndef ROCKSDB_LITE
// A filter object supplied to be invoked while processing write-ahead-logs
// (WALs) during recovery. The filter provides a way to inspect log
// records, ignoring a particular record or skipping replay.
// The filter is invoked at startup and is invoked from a single-thread
// currently.
const WALFilter * wal_filter;
#endif //ROCKSDB_LITE
};
// Options to control the behavior of a database (passed to DB::Open)

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

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

Loading…
Cancel
Save