Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into dp/feature/add-da…
Browse files Browse the repository at this point in the history
…ta-block-index-type

* upstream/master:
  Make DBPath use tempfile. (rust-rocksdb#394)
  Add a doc for optimize_level_style_compaction method (rust-rocksdb#392)
  Fix lifetime parameter for iterators (rust-rocksdb#391)
  Bump librocksdb-sys up to 6.6.4 (rust-rocksdb#389)
  Change APIs that never return error to not return Result (rust-rocksdb#383)
  Do not take into account a windows host build for overall CI status (rust-rocksdb#388)
  Bump uuid and bindgen dependencies (rust-rocksdb#387)
  Fix doc for WriteBatch::delete (rust-rocksdb#376)
  Move to Rust 2018 (rust-rocksdb#375)
  Fix potential segfault when calling next on DBIterator that is at the end of the range (rust-rocksdb#374)
  Minor cleanup in db.rs (rust-rocksdb#373)
  Add flush_cf method to DB (rust-rocksdb#372)
  Simplify conversion on iterator item (rust-rocksdb#364)
  Add set_max_total_wal_size to Options (rust-rocksdb#366)
  Fix minor doc typo (rust-rocksdb#367)
  Options: add set_ratelimiter (rust-rocksdb#369)
  Improve ffi_try macro to make trailing comma optional (rust-rocksdb#371)
  Upgrade rocksdb to v6.4.6 (rust-rocksdb#360)
  • Loading branch information
dvdplm committed Mar 24, 2020
2 parents 2d0b0e3 + f71953d commit 033b733
Show file tree
Hide file tree
Showing 33 changed files with 387 additions and 329 deletions.
18 changes: 4 additions & 14 deletions .travis.yml
@@ -1,6 +1,5 @@
language: rust
dist: xenial
sudo: false
dist: bionic

os:
- linux
Expand All @@ -10,18 +9,9 @@ os:
rust:
- stable

addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty
packages:
- g++
- llvm-dev
- libclang-dev
- clang

cache: cargo
jobs:
allow_failures:
- os: windows

install:
- rustup component add rustfmt
Expand Down
8 changes: 6 additions & 2 deletions Cargo.toml
Expand Up @@ -2,6 +2,7 @@
name = "rocksdb"
description = "Rust wrapper for Facebook's RocksDB embeddable database"
version = "0.13.0"
edition = "2018"
authors = ["Tyler Neely <t@jujit.su>", "David Greenberg <dsg123456789@gmail.com>"]
license = "Apache-2.0"
keywords = ["database", "embedded", "LSM-tree", "persistence"]
Expand All @@ -22,7 +23,10 @@ zstd = ["librocksdb-sys/zstd"]
zlib = ["librocksdb-sys/zlib"]
bzip2 = ["librocksdb-sys/bzip2"]


[dependencies]
libc = "0.2"
librocksdb-sys = { path = "librocksdb-sys", version = "6.2.4" }
librocksdb-sys = { path = "librocksdb-sys", version = "6.4.6" }

[dev-dependencies]
trybuild = "1.0.21"
tempfile = "3.1.0"
8 changes: 4 additions & 4 deletions librocksdb-sys/Cargo.toml
@@ -1,14 +1,14 @@
[package]
name = "librocksdb-sys"
version = "6.2.4"
version = "6.6.4"
edition = "2018"
authors = ["Karl Hobley <karlhobley10@gmail.com>", "Arkadiy Paronyan <arkadiy@ethcore.io>"]
license = "MIT/Apache-2.0/BSD-3-Clause"
description = "Native bindings to librocksdb"
readme = "README.md"
repository = "https://github.com/rust-rocksdb/rust-rocksdb"
keywords = [ "bindings", "ffi", "rocksdb" ]

build = "build.rs"
links = "rocksdb"

[features]
Expand All @@ -26,9 +26,9 @@ libc = "0.2"

[dev-dependencies]
const-cstr = "0.3"
uuid = { version = "0.7", features = ["v4"] }
uuid = { version = "0.8", features = ["v4"] }

[build-dependencies]
cc = { version = "^1.0", features = ["parallel"] }
bindgen = "0.49"
bindgen = "0.53"
glob = "0.3"
18 changes: 7 additions & 11 deletions librocksdb-sys/build.rs
@@ -1,7 +1,3 @@
extern crate bindgen;
extern crate cc;
extern crate glob;

use std::env;
use std::fs;
use std::path::PathBuf;
Expand Down Expand Up @@ -36,6 +32,7 @@ fn bindgen_rocksdb() {
.derive_debug(false)
.blacklist_type("max_align_t") // https://github.com/rust-lang-nursery/rust-bindgen/issues/550
.ctypes_prefix("libc")
.size_t_is_usize(true)
.generate()
.expect("unable to generate rocksdb bindings");

Expand All @@ -51,7 +48,7 @@ fn build_rocksdb() {
let mut config = cc::Build::new();
config.include("rocksdb/include/");
config.include("rocksdb/");
config.include("rocksdb/third-party/gtest-1.7.0/fused-src/");
config.include("rocksdb/third-party/gtest-1.8.1/fused-src/");

if cfg!(feature = "snappy") {
config.define("SNAPPY", Some("1"));
Expand Down Expand Up @@ -84,7 +81,7 @@ fn build_rocksdb() {

let mut lib_sources = include_str!("rocksdb_lib_sources.txt")
.trim()
.split("\n")
.split('\n')
.map(str::trim)
.collect::<Vec<&'static str>>();

Expand Down Expand Up @@ -208,11 +205,10 @@ fn build_lz4() {

compiler.opt_level(3);

match env::var("TARGET").unwrap().as_str() {
"i686-pc-windows-gnu" => {
compiler.flag("-fno-tree-vectorize");
}
_ => {}
let target = env::var("TARGET").unwrap();

if &target == "i686-pc-windows-gnu" {
compiler.flag("-fno-tree-vectorize");
}

compiler.compile("liblz4.a");
Expand Down
4 changes: 2 additions & 2 deletions librocksdb-sys/build_version.cc
@@ -1,4 +1,4 @@
#include "build_version.h"
const char* rocksdb_build_git_sha = "rocksdb_build_git_sha:@76a56d89a7740f8dbb01edabf1ea5abc95a67657@";
const char* rocksdb_build_git_date = "rocksdb_build_git_date:@2019/10/16 09:47:38@";
const char* rocksdb_build_git_sha = "rocksdb_build_git_sha:@551a110918493a19d11243f53408b97485de1411@";
const char* rocksdb_build_git_date = "rocksdb_build_git_date:@2020/02/01 12:07:58@";
const char* rocksdb_build_compile_date = __DATE__;
128 changes: 72 additions & 56 deletions librocksdb-sys/rocksdb_lib_sources.txt
@@ -1,27 +1,29 @@
cache/clock_cache.cc
cache/lru_cache.cc
cache/sharded_cache.cc
db/arena_wrapped_db_iter.cc
db/builder.cc
db/c.cc
db/column_family.cc
db/compacted_db_impl.cc
db/compaction.cc
db/compaction_iterator.cc
db/compaction_job.cc
db/compaction_picker.cc
db/compaction_picker_fifo.cc
db/compaction_picker_universal.cc
db/compaction/compaction.cc
db/compaction/compaction_iterator.cc
db/compaction/compaction_job.cc
db/compaction/compaction_picker.cc
db/compaction/compaction_picker_fifo.cc
db/compaction/compaction_picker_level.cc
db/compaction/compaction_picker_universal.cc
db/convenience.cc
db/db_filesnapshot.cc
db/db_impl.cc
db/db_impl_compaction_flush.cc
db/db_impl_debug.cc
db/db_impl_experimental.cc
db/db_impl_files.cc
db/db_impl_open.cc
db/db_impl_readonly.cc
db/db_impl_secondary.cc
db/db_impl_write.cc
db/db_impl/db_impl.cc
db/db_impl/db_impl_compaction_flush.cc
db/db_impl/db_impl_debug.cc
db/db_impl/db_impl_experimental.cc
db/db_impl/db_impl_files.cc
db/db_impl/db_impl_open.cc
db/db_impl/db_impl_readonly.cc
db/db_impl/db_impl_secondary.cc
db/db_impl/db_impl_write.cc
db/db_info_dumper.cc
db/db_iter.cc
db/dbformat.cc
Expand All @@ -33,7 +35,7 @@ db/file_indexer.cc
db/flush_job.cc
db/flush_scheduler.cc
db/forward_iterator.cc
db/in_memory_stats_history.cc
db/import_column_family_job.cc
db/internal_stats.cc
db/logs_with_prep_tracker.cc
db/log_reader.cc
Expand All @@ -50,6 +52,7 @@ db/snapshot_impl.cc
db/table_cache.cc
db/table_properties_collector.cc
db/transaction_log_impl.cc
db/trim_history_scheduler.cc
db/version_builder.cc
db/version_edit.cc
db/version_set.cc
Expand All @@ -65,6 +68,22 @@ env/env_hdfs.cc
env/env_posix.cc
env/io_posix.cc
env/mock_env.cc
file/delete_scheduler.cc
file/file_prefetch_buffer.cc
file/file_util.cc
file/filename.cc
file/random_access_file_reader.cc
file/read_write_util.cc
file/readahead_raf.cc
file/sequence_file_reader.cc
file/sst_file_manager_impl.cc
file/writable_file_writer.cc
logging/auto_roll_logger.cc
logging/event_logger.cc
logging/log_buffer.cc
memory/arena.cc
memory/concurrent_arena.cc
memory/jemalloc_nodump_allocator.cc
memtable/alloc_tracker.cc
memtable/hash_linklist_rep.cc
memtable/hash_skiplist_rep.cc
Expand All @@ -73,10 +92,12 @@ memtable/vectorrep.cc
memtable/write_buffer_manager.cc
monitoring/histogram.cc
monitoring/histogram_windowing.cc
monitoring/in_memory_stats_history.cc
monitoring/instrumented_mutex.cc
monitoring/iostats_context.cc
monitoring/perf_context.cc
monitoring/perf_level.cc
monitoring/persistent_stats_history.cc
monitoring/statistics.cc
monitoring/thread_status_impl.cc
monitoring/thread_status_updater.cc
Expand All @@ -91,75 +112,67 @@ options/options_parser.cc
options/options_sanity_check.cc
port/port_posix.cc
port/stack_trace.cc
table/adaptive_table_factory.cc
table/block.cc
table/block_based_filter_block.cc
table/block_based_table_builder.cc
table/block_based_table_factory.cc
table/block_based_table_reader.cc
table/block_builder.cc
table/adaptive/adaptive_table_factory.cc
table/block_based/block.cc
table/block_based/block_based_filter_block.cc
table/block_based/block_based_table_builder.cc
table/block_based/block_based_table_factory.cc
table/block_based/block_based_table_reader.cc
table/block_based/block_builder.cc
table/block_based/block_prefix_index.cc
table/block_based/data_block_hash_index.cc
table/block_based/data_block_footer.cc
table/block_based/filter_block_reader_common.cc
table/block_based/filter_policy.cc
table/block_based/flush_block_policy.cc
table/block_based/full_filter_block.cc
table/block_based/index_builder.cc
table/block_based/parsed_full_filter_block.cc
table/block_based/partitioned_filter_block.cc
table/block_based/uncompression_dict_reader.cc
table/block_fetcher.cc
table/block_prefix_index.cc
table/bloom_block.cc
table/cuckoo_table_builder.cc
table/cuckoo_table_factory.cc
table/cuckoo_table_reader.cc
table/data_block_hash_index.cc
table/data_block_footer.cc
table/flush_block_policy.cc
table/cuckoo/cuckoo_table_builder.cc
table/cuckoo/cuckoo_table_factory.cc
table/cuckoo/cuckoo_table_reader.cc
table/format.cc
table/full_filter_block.cc
table/get_context.cc
table/index_builder.cc
table/iterator.cc
table/merging_iterator.cc
table/meta_blocks.cc
table/partitioned_filter_block.cc
table/persistent_cache_helper.cc
table/plain_table_builder.cc
table/plain_table_factory.cc
table/plain_table_index.cc
table/plain_table_key_coding.cc
table/plain_table_reader.cc
table/plain/plain_table_bloom.cc
table/plain/plain_table_builder.cc
table/plain/plain_table_factory.cc
table/plain/plain_table_index.cc
table/plain/plain_table_key_coding.cc
table/plain/plain_table_reader.cc
table/sst_file_reader.cc
table/sst_file_writer.cc
table/table_properties.cc
table/two_level_iterator.cc
test_util/sync_point.cc
test_util/sync_point_impl.cc
test_util/transaction_test_util.cc
tools/dump/db_dump_tool.cc
util/arena.cc
util/auto_roll_logger.cc
util/bloom.cc
trace_replay/trace_replay.cc
trace_replay/block_cache_tracer.cc
util/build_version.cc
util/coding.cc
util/compaction_job_stats_impl.cc
util/comparator.cc
util/compression_context_cache.cc
util/concurrent_arena.cc
util/concurrent_task_limiter_impl.cc
util/crc32c.cc
util/delete_scheduler.cc
util/dynamic_bloom.cc
util/event_logger.cc
util/file_reader_writer.cc
util/file_util.cc
util/filename.cc
util/filter_policy.cc
util/hash.cc
util/jemalloc_nodump_allocator.cc
util/log_buffer.cc
util/murmurhash.cc
util/random.cc
util/rate_limiter.cc
util/slice.cc
util/sst_file_manager_impl.cc
util/status.cc
util/string_util.cc
util/sync_point.cc
util/sync_point_impl.cc
util/thread_local.cc
util/threadpool_imp.cc
util/trace_replay.cc
util/transaction_test_util.cc
util/xxhash.cc
utilities/backupable/backupable_db.cc
utilities/blob_db/blob_compaction_filter.cc
Expand All @@ -183,17 +196,20 @@ utilities/leveldb_options/leveldb_options.cc
utilities/memory/memory_util.cc
utilities/merge_operators/max.cc
utilities/merge_operators/put.cc
utilities/merge_operators/sortlist.cc
utilities/merge_operators/string_append/stringappend.cc
utilities/merge_operators/string_append/stringappend2.cc
utilities/merge_operators/uint64add.cc
utilities/merge_operators/bytesxor.cc
utilities/object_registry.cc
utilities/option_change_migration/option_change_migration.cc
utilities/options/options_util.cc
utilities/persistent_cache/block_cache_tier.cc
utilities/persistent_cache/block_cache_tier_file.cc
utilities/persistent_cache/block_cache_tier_metadata.cc
utilities/persistent_cache/persistent_cache_tier.cc
utilities/persistent_cache/volatile_tier_impl.cc
utilities/simulator_cache/cache_simulator.cc
utilities/simulator_cache/sim_cache.cc
utilities/table_properties_collectors/compact_on_deletion_collector.cc
utilities/trace/file_trace_reader_writer.cc
Expand Down
6 changes: 1 addition & 5 deletions librocksdb-sys/src/lib.rs
Expand Up @@ -16,14 +16,10 @@
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]

extern crate libc;

use libc::c_int;

include!(concat!(env!("OUT_DIR"), "/bindings.rs"));

#[cfg(feature = "bzip2")]
#[no_mangle]
pub fn bz_internal_error(errcode: c_int) {
pub fn bz_internal_error(errcode: libc::c_int) {
panic!("bz internal error: {}", errcode);
}

0 comments on commit 033b733

Please sign in to comment.