From 50d7ac0ea3aea74e6a7bdd78f9adde0839cbc5fc Mon Sep 17 00:00:00 2001 From: Zhongyi Xie Date: Fri, 1 Jun 2018 20:28:19 -0700 Subject: [PATCH] Fix test for rocksdb_lite: hide incompatible option kDirectIO Summary: Previous commit https://github.com/facebook/rocksdb/pull/3935 unhide a few test options which includes kDirectIO. However it's not supported by RocksDB lite. Need to hide this option from the lite build. Closes https://github.com/facebook/rocksdb/pull/3943 Differential Revision: D8242757 Pulled By: miasantreble fbshipit-source-id: 1edfad3a5d01a46bfb7eedee765981ebe02c500a --- db/db_test_util.cc | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/db/db_test_util.cc b/db/db_test_util.cc index 107a7f167..4d4da94a3 100644 --- a/db/db_test_util.cc +++ b/db/db_test_util.cc @@ -346,6 +346,26 @@ Options DBTestBase::GetOptions( NewHashCuckooRepFactory(options.write_buffer_size)); options.allow_concurrent_memtable_write = false; break; + case kDirectIO: { + options.use_direct_reads = true; + options.use_direct_io_for_flush_and_compaction = true; + options.compaction_readahead_size = 2 * 1024 * 1024; + #if !defined(OS_MACOSX) && !defined(OS_WIN) && !defined(OS_SOLARIS) && \ + !defined(OS_AIX) && !defined(OS_OPENBSD) + rocksdb::SyncPoint::GetInstance()->SetCallBack( + "NewWritableFile:O_DIRECT", [&](void* arg) { + int* val = static_cast(arg); + *val &= ~O_DIRECT; + }); + rocksdb::SyncPoint::GetInstance()->SetCallBack( + "NewRandomAccessFile:O_DIRECT", [&](void* arg) { + int* val = static_cast(arg); + *val &= ~O_DIRECT; + }); + rocksdb::SyncPoint::GetInstance()->EnableProcessing(); + #endif + break; + } #endif // ROCKSDB_LITE case kMergePut: options.merge_operator = MergeOperators::CreatePutOperator(); @@ -460,26 +480,6 @@ Options DBTestBase::GetOptions( options.enable_write_thread_adaptive_yield = true; break; } - case kDirectIO: { - options.use_direct_reads = true; - options.use_direct_io_for_flush_and_compaction = true; - options.compaction_readahead_size = 2 * 1024 * 1024; -#if !defined(OS_MACOSX) && !defined(OS_WIN) && !defined(OS_SOLARIS) && \ - !defined(OS_AIX) && !defined(OS_OPENBSD) - rocksdb::SyncPoint::GetInstance()->SetCallBack( - "NewWritableFile:O_DIRECT", [&](void* arg) { - int* val = static_cast(arg); - *val &= ~O_DIRECT; - }); - rocksdb::SyncPoint::GetInstance()->SetCallBack( - "NewRandomAccessFile:O_DIRECT", [&](void* arg) { - int* val = static_cast(arg); - *val &= ~O_DIRECT; - }); - rocksdb::SyncPoint::GetInstance()->EnableProcessing(); -#endif - break; - } case kPipelinedWrite: { options.enable_pipelined_write = true; break;