Merge branch 'master' into immutable-op-cf

master
Oleksandr Anyshchenko 6 years ago committed by GitHub
commit e485881f71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      .travis.yml
  2. 43
      MAINTAINERSHIP.md
  3. 2
      README.md
  4. 10
      src/db.rs
  5. 8
      src/db_options.rs
  6. 6
      src/merge_operator.rs

@ -2,6 +2,10 @@ language: rust
dist: trusty
sudo: true
os:
- linux
- osx
rust:
- stable
- beta

@ -0,0 +1,43 @@
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
* 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.
* 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.

@ -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)

@ -20,7 +20,7 @@ use ffi_util::opt_bytes_to_ptr;
use libc::{self, c_char, c_int, c_uchar, c_void, size_t};
use std::collections::BTreeMap;
use std::ffi::CString;
use std::ffi::{CStr, CString};
use std::fmt;
use std::fs;
use std::ops::Deref;
@ -699,8 +699,7 @@ impl DB {
}
pub fn list_cf<P: AsRef<Path>>(opts: &Options, path: P) -> Result<Vec<String>, 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(
@ -720,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)
}
}

@ -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();

@ -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::<ValueCounts>(&*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::<ValueCounts>(&*value) {
Some(v) => {
Some(v) => unsafe {
assert_eq!(v.num_a, 3);
assert_eq!(v.num_b, 2);
assert_eq!(v.num_c, 0);

Loading…
Cancel
Save