From 5a2647a436a3017784dec33b9388833b645bb423 Mon Sep 17 00:00:00 2001 From: Oleksandr Anyshchenko Date: Tue, 31 Jul 2018 16:12:14 +0300 Subject: [PATCH 1/7] Got rid of some rust compiler warnings. --- src/db_options.rs | 8 ++++++-- src/merge_operator.rs | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/db_options.rs b/src/db_options.rs index ba9bbad..9d252fb 100644 --- a/src/db_options.rs +++ b/src/db_options.rs @@ -1061,11 +1061,15 @@ impl Options { } } - /// When a `prefix_extractor` is defined through `opts.set_prefix_extractor` this creates a - /// prefix bloom filter for each memtable with the size of + /// When a `prefix_extractor` is defined through `opts.set_prefix_extractor` this + /// creates a prefix bloom filter for each memtable with the size of /// `write_buffer_size * memtable_prefix_bloom_ratio` (capped at 0.25). /// /// Default: `0` + /// + /// # Example + /// + /// ``` /// use rocksdb::{Options, SliceTransform}; /// /// let mut opts = Options::default(); diff --git a/src/merge_operator.rs b/src/merge_operator.rs index ef86323..70a202c 100644 --- a/src/merge_operator.rs +++ b/src/merge_operator.rs @@ -278,7 +278,7 @@ mod test { #[repr(packed)] - #[derive(Clone, Debug)] + #[derive(Copy, Clone, Debug)] struct ValueCounts { num_a: u32, num_b: u32, @@ -423,7 +423,7 @@ mod test { match db.get(b"k2") { Ok(Some(value)) => { match from_slice::(&*value) { - Some(v) => { + Some(v) => unsafe { assert_eq!(v.num_a, 1000); assert_eq!(v.num_b, 500); assert_eq!(v.num_c, 2000); @@ -438,7 +438,7 @@ mod test { match db.get(b"k1") { Ok(Some(value)) => { match from_slice::(&*value) { - Some(v) => { + Some(v) => unsafe { assert_eq!(v.num_a, 3); assert_eq!(v.num_b, 2); assert_eq!(v.num_c, 0); From 9a7270ef9dffdb8b9b7d5c6cf2d4d85563e52a45 Mon Sep 17 00:00:00 2001 From: Oleksandr Anyshchenko Date: Tue, 31 Jul 2018 17:22:40 +0300 Subject: [PATCH 2/7] Fixed crash `test_column_family` test on macOS --- src/db.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/db.rs b/src/db.rs index 78fd8c7..6cca63f 100644 --- a/src/db.rs +++ b/src/db.rs @@ -28,6 +28,7 @@ use std::path::Path; use std::ptr; use std::slice; use std::str; +use std::ffi::CStr; pub fn new_bloom_filter(bits: c_int) -> *mut ffi::rocksdb_filterpolicy_t { unsafe { ffi::rocksdb_filterpolicy_create_bloom(bits) } @@ -698,8 +699,7 @@ impl DB { } pub fn list_cf>(opts: &Options, path: P) -> Result, Error> { - let path = path.as_ref(); - let cpath = match CString::new(path.to_string_lossy().as_bytes()) { + let cpath = match CString::new(path.as_ref().to_string_lossy().as_bytes()) { Ok(c) => c, Err(_) => { return Err(Error::new( @@ -719,10 +719,11 @@ impl DB { &mut length, )); - let vec = Vec::from_raw_parts(ptr, length, length) + let vec = slice::from_raw_parts(ptr, length) .iter() - .map(|&ptr| CString::from_raw(ptr).into_string().unwrap()) + .map(|ptr| CStr::from_ptr(*ptr).to_string_lossy().into_owned()) .collect(); + ffi::rocksdb_list_column_families_destroy(ptr, length); Ok(vec) } } From 9f5c1f5c01cb0bdd5c28bb719a23fec4ad4bc4d1 Mon Sep 17 00:00:00 2001 From: Oleksandr Anyshchenko Date: Wed, 1 Aug 2018 09:50:24 +0300 Subject: [PATCH 3/7] Added travis build on macOS --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 3632ba6..f0e0916 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,10 @@ language: rust dist: trusty sudo: true +os: +- linux +- osx + rust: - stable - beta From a3f4cb4aa76b88ff3f1ad4696fe9ebf00e9f8e33 Mon Sep 17 00:00:00 2001 From: Tyler Neely Date: Sat, 13 Oct 2018 09:56:22 +0200 Subject: [PATCH 4/7] Create MAINTAINERSHIP.md --- MAINTAINERSHIP.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 MAINTAINERSHIP.md diff --git a/MAINTAINERSHIP.md b/MAINTAINERSHIP.md new file mode 100644 index 0000000..5095a75 --- /dev/null +++ b/MAINTAINERSHIP.md @@ -0,0 +1,42 @@ +Maintainers agree to operate under this set of guidelines: + +#### Authority + +Maintainers are trusted to close issues, merge pull requests, and publish crates to cargo. + +#### Categories of Work + +0. Minor + * updating the changelog + * requires no approval +1. Normal + * librocksdb-sys updates + * API tracking code in the rocksdb crate that does not change control flow + * breaking changes due to removed functionality in rocksdb + * require 1 approval from another maintainer. if no maintainer is able to be reached for 2 weeks, then progress may be made anyway + * patch (and post-1.0, minor) releases to crates.io that contain only the above work +2. Major + * breaking API changes that are not direct consequences of underlying rocksdb changes + * refactoring, which should generally only be done for clearly functional reasons like to aid in the completion of a specific task + * require consensus among all maintainers unless 2 weeks have gone by without full participation + * if 2 weeks have gone by after seeking feedback, and at least one other maintainer has participated, and all participating maintainers are in agreement, then progress may be made anyway + * if action is absolutely urgent, an organization owner may act as a tiebreaker if specifically requested to do so and they agree that making a controversial decision is worth the risk. This should hopefully never occur. + +If any maintainer thinks an issue is major, it is major. + +#### Changelog Maintenance + +* If you are the one who merges a PR that includes an externally-visible change, please describe the change in the changelog and merge it in. + +#### Releasing, Publishing + +* To cut a release, an issue should be opened for it and reach the required approval based on the above `Categories of Work` section above +* When progress is possible, the issue may be closed and the proposer may publish to crates.io. This is controlled by those in the [crate publishers organization-level team](https://github.com/orgs/rust-rocksdb/teams/crate-publishers). +* Releases should have an associated tag pushed to this repo +* The changelog serves as a sort of logical staging area for releases +* If a breaking API change happens, and the changelog has not advanced to a new major version, we roll the changelog to a new major version and open an issue to release the previous patch (and post-1.0, minor) version. +* Before rolling to a new major version, it would be nice to release a non-breaking point release to let current users silently take advantage of any improvements + +#### Becoming a Maintainer + +* If you have a history of participation in this repo, agree to these rules, and wish to take on maintainership responsibilities, you may open an issue. If an owner agrees, they will add you to the maintainer group and the crate publishers team. From 4ee361d273ef458e6ecbfc8ced9013009a396eac Mon Sep 17 00:00:00 2001 From: Tyler Neely Date: Sat, 13 Oct 2018 10:02:39 +0200 Subject: [PATCH 5/7] Update MAINTAINERSHIP.md --- MAINTAINERSHIP.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERSHIP.md b/MAINTAINERSHIP.md index 5095a75..a691cae 100644 --- a/MAINTAINERSHIP.md +++ b/MAINTAINERSHIP.md @@ -32,7 +32,7 @@ If any maintainer thinks an issue is major, it is major. * To cut a release, an issue should be opened for it and reach the required approval based on the above `Categories of Work` section above * When progress is possible, the issue may be closed and the proposer may publish to crates.io. This is controlled by those in the [crate publishers organization-level team](https://github.com/orgs/rust-rocksdb/teams/crate-publishers). -* Releases should have an associated tag pushed to this repo +* Releases should have an associated tag pushed to this repo. I recommend doing this after the publish to crates.io succeeds to prevent any mishaps around pushing a tag for something that can't actually be published. * The changelog serves as a sort of logical staging area for releases * If a breaking API change happens, and the changelog has not advanced to a new major version, we roll the changelog to a new major version and open an issue to release the previous patch (and post-1.0, minor) version. * Before rolling to a new major version, it would be nice to release a non-breaking point release to let current users silently take advantage of any improvements From fad49c206cf43331e4704d9946f782c1e9d3131b Mon Sep 17 00:00:00 2001 From: Tyler Neely Date: Sat, 3 Nov 2018 18:19:19 +0100 Subject: [PATCH 6/7] Update MAINTAINERSHIP.md --- MAINTAINERSHIP.md | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERSHIP.md b/MAINTAINERSHIP.md index a691cae..af038c4 100644 --- a/MAINTAINERSHIP.md +++ b/MAINTAINERSHIP.md @@ -30,6 +30,7 @@ If any maintainer thinks an issue is major, it is major. #### Releasing, Publishing +* Releases adhere to [semver](https://semver.org/) * To cut a release, an issue should be opened for it and reach the required approval based on the above `Categories of Work` section above * When progress is possible, the issue may be closed and the proposer may publish to crates.io. This is controlled by those in the [crate publishers organization-level team](https://github.com/orgs/rust-rocksdb/teams/crate-publishers). * Releases should have an associated tag pushed to this repo. I recommend doing this after the publish to crates.io succeeds to prevent any mishaps around pushing a tag for something that can't actually be published. From d4a813c2f118e766418614fedbe844c7a9090cc5 Mon Sep 17 00:00:00 2001 From: Oleksandr Anyshchenko Date: Mon, 5 Nov 2018 10:36:56 +0200 Subject: [PATCH 7/7] Fix travis status link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 53e0d98..b1dd706 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ rust-rocksdb ============ -[![Build Status](https://travis-ci.org/spacejam/rust-rocksdb.svg?branch=master)](https://travis-ci.org/spacejam/rust-rocksdb) +[![Build Status](https://travis-ci.org/rust-rocksdb/rust-rocksdb.svg?branch=master)](https://travis-ci.org/rust-rocksdb/rust-rocksdb) [![crates.io](http://meritbadge.herokuapp.com/rocksdb)](https://crates.io/crates/rocksdb) [![documentation](https://docs.rs/rocksdb/badge.svg)](https://docs.rs/rocksdb)