Skip to content

Commit

Permalink
Merge pull request rust-rocksdb#5 from pingcap/busyjay/fix-undefined-…
Browse files Browse the repository at this point in the history
…symbol
  • Loading branch information
siddontang authored Jan 22, 2017
2 parents 1a8222b + a55a068 commit 92ccc82
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 16 deletions.
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion librocksdb_sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 5 additions & 1 deletion src/rocksdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
}
}
Expand Down
9 changes: 2 additions & 7 deletions src/rocksdb_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit 92ccc82

Please sign in to comment.