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
This commit is contained in:
parent
fea2b1dfb2
commit
50d7ac0ea3
@ -346,6 +346,26 @@ Options DBTestBase::GetOptions(
|
|||||||
NewHashCuckooRepFactory(options.write_buffer_size));
|
NewHashCuckooRepFactory(options.write_buffer_size));
|
||||||
options.allow_concurrent_memtable_write = false;
|
options.allow_concurrent_memtable_write = false;
|
||||||
break;
|
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<int*>(arg);
|
||||||
|
*val &= ~O_DIRECT;
|
||||||
|
});
|
||||||
|
rocksdb::SyncPoint::GetInstance()->SetCallBack(
|
||||||
|
"NewRandomAccessFile:O_DIRECT", [&](void* arg) {
|
||||||
|
int* val = static_cast<int*>(arg);
|
||||||
|
*val &= ~O_DIRECT;
|
||||||
|
});
|
||||||
|
rocksdb::SyncPoint::GetInstance()->EnableProcessing();
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
}
|
||||||
#endif // ROCKSDB_LITE
|
#endif // ROCKSDB_LITE
|
||||||
case kMergePut:
|
case kMergePut:
|
||||||
options.merge_operator = MergeOperators::CreatePutOperator();
|
options.merge_operator = MergeOperators::CreatePutOperator();
|
||||||
@ -460,26 +480,6 @@ Options DBTestBase::GetOptions(
|
|||||||
options.enable_write_thread_adaptive_yield = true;
|
options.enable_write_thread_adaptive_yield = true;
|
||||||
break;
|
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<int*>(arg);
|
|
||||||
*val &= ~O_DIRECT;
|
|
||||||
});
|
|
||||||
rocksdb::SyncPoint::GetInstance()->SetCallBack(
|
|
||||||
"NewRandomAccessFile:O_DIRECT", [&](void* arg) {
|
|
||||||
int* val = static_cast<int*>(arg);
|
|
||||||
*val &= ~O_DIRECT;
|
|
||||||
});
|
|
||||||
rocksdb::SyncPoint::GetInstance()->EnableProcessing();
|
|
||||||
#endif
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case kPipelinedWrite: {
|
case kPipelinedWrite: {
|
||||||
options.enable_pipelined_write = true;
|
options.enable_pipelined_write = true;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user