Commit 92ccc82a authored by siddontang's avatar siddontang Committed by GitHub

Merge pull request #5 from pingcap/busyjay/fix-undefined-symbol

parents 1a8222bb a55a0681
......@@ -26,11 +26,7 @@ Feedback and pull requests welcome! If a particular feature of RocksDB is impor
First, use your system's package manager to install snappy. This is optional, but lets rocksdb take advantage of better compression, and some code may require it.
```bash
wget https://github.com/facebook/rocksdb/archive/rocksdb-3.8.tar.gz
tar xvf rocksdb-3.8.tar.gz && cd rocksdb-rocksdb-3.8 && make shared_lib
sudo make install
```
To install rocksdb, please refer to it's installation guide. For Windows users, please make sure you configure rocksdb with `CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS` enabled.
### Running
###### Cargo.toml
......@@ -178,7 +174,6 @@ fn badly_tuned_for_somebody_elses_disk() -> DB {
opts.set_compaction_style(DBUniversalCompaction);
opts.set_max_background_compactions(4);
opts.set_max_background_flushes(4);
opts.set_filter_deletes(false);
opts.set_disable_auto_compactions(true);
DB::open(&opts, path).unwrap()
......
......@@ -185,7 +185,6 @@ extern "C" {
max_bg_compactions: c_int);
pub fn crocksdb_options_set_max_background_flushes(options: *mut DBOptions,
max_bg_flushes: c_int);
pub fn crocksdb_options_set_filter_deletes(options: *mut DBOptions, v: bool);
pub fn crocksdb_options_set_disable_auto_compactions(options: *mut DBOptions, v: c_int);
pub fn crocksdb_options_set_report_bg_io_stats(options: *mut DBOptions, v: c_int);
pub fn crocksdb_options_set_compaction_readahead_size(options: *mut DBOptions, v: size_t);
......
......@@ -176,7 +176,6 @@ mod tests {
opts.set_compaction_style(DBUniversal);
opts.set_max_background_compactions(4);
opts.set_max_background_flushes(4);
opts.set_filter_deletes(false);
opts.set_report_bg_io_stats(true);
opts.set_wal_recovery_mode(DBRecoveryMode::PointInTime);
opts.enable_statistics();
......
......@@ -1220,7 +1220,11 @@ mod test {
let opts = Options::new();
// The DB will still be open when we try to destroy and the lock should fail
match DB::destroy(&opts, path_str) {
Err(ref s) => assert!(s.contains("LOCK: No locks available")),
Err(ref s) => {
assert!(s.contains("IO error: ") && s.contains("lock"),
"expect lock fail, but got {}",
s);
}
Ok(_) => panic!("should fail"),
}
}
......
......@@ -487,12 +487,6 @@ impl Options {
}
}
pub fn set_filter_deletes(&mut self, filter: bool) {
unsafe {
crocksdb_ffi::crocksdb_options_set_filter_deletes(self.inner, filter);
}
}
pub fn set_disable_auto_compactions(&mut self, disable: bool) {
unsafe {
if disable {
......@@ -603,7 +597,8 @@ impl Options {
pub fn set_compaction_readahead_size(&mut self, size: u64) {
unsafe {
crocksdb_ffi::crocksdb_options_set_compaction_readahead_size(self.inner, size as size_t);
crocksdb_ffi::crocksdb_options_set_compaction_readahead_size(self.inner,
size as size_t);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment