You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
rust-rocksdb/tests/test_rocksdb_options.rs

72 lines
2.2 KiB

// Copyright 2014 Tyler Neely
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
extern crate rocksdb;
mod util;
use rocksdb::{BlockBasedOptions, Options, ReadOptions, DB};
use util::DBPath;
#[test]
fn test_set_num_levels() {
let n = DBPath::new("_rust_rocksdb_test_set_num_levels");
{
let mut opts = Options::default();
opts.create_if_missing(true);
opts.set_num_levels(2);
let _db = DB::open(&opts, &n).unwrap();
}
}
#[test]
fn test_increase_parallelism() {
let n = DBPath::new("_rust_rocksdb_test_increase_parallelism");
{
let mut opts = Options::default();
opts.create_if_missing(true);
opts.increase_parallelism(4);
let _db = DB::open(&opts, &n).unwrap();
}
}
#[test]
fn test_set_level_compaction_dynamic_level_bytes() {
let n = DBPath::new("_rust_rocksdb_test_set_level_compaction_dynamic_level_bytes");
{
let mut opts = Options::default();
opts.create_if_missing(true);
opts.set_level_compaction_dynamic_level_bytes(true);
let _db = DB::open(&opts, &n).unwrap();
}
}
#[test]
fn test_set_pin_l0_filter_and_index_blocks_in_cache() {
let n = DBPath::new("_rust_rocksdb_test_set_pin_l0_filter_and_index_blocks_in_cache");
{
let mut opts = Options::default();
opts.create_if_missing(true);
let mut block_opts = BlockBasedOptions::default();
block_opts.set_cache_index_and_filter_blocks(true);
block_opts.set_pin_l0_filter_and_index_blocks_in_cache(true);
opts.set_block_based_table_factory(&block_opts);
let _db = DB::open(&opts, &n).unwrap();
}
}
#[test]
fn test_read_options() {
let mut read_opts = ReadOptions::default();
read_opts.set_verify_checksums(false);
}