| 12 | #include <sys/statvfs.h> |
| 13 | |
| 14 | rocksdb::Options DefaultRocksDBOptions() { |
| 15 | rocksdb::Options options; |
| 16 | options.max_background_compactions = 4; |
| 17 | options.max_background_flushes = 2; |
| 18 | options.bytes_per_sync = 1048576; |
| 19 | options.compaction_pri = rocksdb::kMinOverlappingRatio; |
| 20 | options.compression = rocksdb::kNoCompression; |
| 21 | options.enable_pipelined_write = true; |
| 22 | options.allow_mmap_reads = true; |
| 23 | options.avoid_unnecessary_blocking_io = true; |
| 24 | options.prefix_extractor.reset(rocksdb::NewFixedPrefixTransform(0)); |
| 25 | |
| 26 | rocksdb::BlockBasedTableOptions table_options; |
| 27 | table_options.block_size = 16 * 1024; |
| 28 | table_options.cache_index_and_filter_blocks = true; |
| 29 | table_options.pin_l0_filter_and_index_blocks_in_cache = true; |
| 30 | table_options.data_block_index_type = rocksdb::BlockBasedTableOptions::kDataBlockBinaryAndHash; |
| 31 | table_options.checksum = rocksdb::kNoChecksum; |
| 32 | table_options.format_version = 4; |
| 33 | options.table_factory.reset(NewBlockBasedTableFactory(table_options)); |
| 34 | |
| 35 | return options; |
| 36 | } |
| 37 | |
| 38 | IStorageFactory *CreateRocksDBStorageFactory(const char *path, int dbnum, const char *rgchConfig, size_t cchConfig) |
| 39 | { |
no test coverage detected