From 5d46bf7c8485b6b98db077ab7abe95b6330e0c38 Mon Sep 17 00:00:00 2001 From: zaidoon Date: Sat, 10 Feb 2024 10:40:20 -0500 Subject: [PATCH] update code imports after package name change and clean up README/MAINTAINERHSIP --- MAINTAINERSHIP.md | 4 +--- README.md | 10 ++-------- tests/test_backup.rs | 2 +- tests/test_checkpoint.rs | 2 +- tests/test_column_family.rs | 14 ++++++++------ tests/test_comparator.rs | 2 +- tests/test_compationfilter.rs | 2 +- tests/test_db.rs | 12 ++++++------ tests/test_iterator.rs | 22 +++++++++++----------- tests/test_merge_operator.rs | 2 +- tests/test_multithreaded.rs | 2 +- tests/test_optimistic_transaction_db.rs | 2 +- tests/test_pinnable_slice.rs | 2 +- tests/test_property.rs | 2 +- tests/test_raw_iterator.rs | 2 +- tests/test_rocksdb_options.rs | 2 +- tests/test_slice_transform.rs | 2 +- tests/test_sst_file_writer.rs | 2 +- tests/test_transaction_db.rs | 2 +- tests/test_write_batch.rs | 2 +- tests/util/mod.rs | 2 +- 21 files changed, 44 insertions(+), 50 deletions(-) diff --git a/MAINTAINERSHIP.md b/MAINTAINERSHIP.md index af038c4..16f525e 100644 --- a/MAINTAINERSHIP.md +++ b/MAINTAINERSHIP.md @@ -31,9 +31,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. +* 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 diff --git a/README.md b/README.md index f4ef392..9c96841 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,8 @@ rust-rocksdb ============ -![RocksDB build](https://github.com/rust-rocksdb/rust-rocksdb/workflows/RocksDB%20build/badge.svg?branch=master) -[![crates.io](https://img.shields.io/crates/v/rocksdb.svg)](https://crates.io/crates/rocksdb) -[![documentation](https://docs.rs/rocksdb/badge.svg)](https://docs.rs/rocksdb) -[![license](https://img.shields.io/crates/l/rocksdb.svg)](https://github.com/rust-rocksdb/rust-rocksdb/blob/master/LICENSE) -[![Gitter chat](https://badges.gitter.im/rust-rocksdb/gitter.png)](https://gitter.im/rust-rocksdb/lobby) -![rust 1.66.0 required](https://img.shields.io/badge/rust-1.66.0-blue.svg?label=MSRV) - -![GitHub commits (since latest release)](https://img.shields.io/github/commits-since/rust-rocksdb/rust-rocksdb/latest.svg) +[![license](https://img.shields.io/crates/l/rocksdb.svg)](https://github.com/zaidoon1/rust-rocksdb/blob/master/LICENSE) +![rust 1.75.0 required](https://img.shields.io/badge/rust-1.75.0-blue.svg?label=MSRV) ## Requirements diff --git a/tests/test_backup.rs b/tests/test_backup.rs index 8de97b1..4d8b080 100644 --- a/tests/test_backup.rs +++ b/tests/test_backup.rs @@ -16,7 +16,7 @@ mod util; use pretty_assertions::assert_eq; -use rocksdb::{ +use rust_rocksdb::{ backup::{BackupEngine, BackupEngineOptions, RestoreOptions}, Env, DB, }; diff --git a/tests/test_checkpoint.rs b/tests/test_checkpoint.rs index adacfcb..10c41ec 100644 --- a/tests/test_checkpoint.rs +++ b/tests/test_checkpoint.rs @@ -16,7 +16,7 @@ mod util; use pretty_assertions::assert_eq; -use rocksdb::{checkpoint::Checkpoint, Options, DB}; +use rust_rocksdb::{checkpoint::Checkpoint, Options, DB}; use util::DBPath; #[test] diff --git a/tests/test_column_family.rs b/tests/test_column_family.rs index 0daee9b..1461385 100644 --- a/tests/test_column_family.rs +++ b/tests/test_column_family.rs @@ -16,8 +16,10 @@ mod util; use pretty_assertions::assert_eq; -use rocksdb::{ColumnFamilyDescriptor, MergeOperands, Options, DB, DEFAULT_COLUMN_FAMILY_NAME}; -use rocksdb::{TransactionDB, TransactionDBOptions}; +use rust_rocksdb::{ + ColumnFamilyDescriptor, MergeOperands, Options, DB, DEFAULT_COLUMN_FAMILY_NAME, +}; +use rust_rocksdb::{TransactionDB, TransactionDBOptions}; use util::DBPath; use std::fs; @@ -25,9 +27,9 @@ use std::io; use std::path::Path; #[cfg(feature = "multi-threaded-cf")] -use rocksdb::MultiThreaded; +use rust_rocksdb::MultiThreaded; #[cfg(not(feature = "multi-threaded-cf"))] -use rocksdb::SingleThreaded; +use rust_rocksdb::SingleThreaded; fn dir_size(path: impl AsRef) -> io::Result { fn dir_size(mut dir: fs::ReadDir) -> io::Result { @@ -441,7 +443,7 @@ fn test_no_leaked_column_family() { opts.create_if_missing(true); opts.create_missing_column_families(true); - let mut write_options = rocksdb::WriteOptions::default(); + let mut write_options = rust_rocksdb::WriteOptions::default(); write_options.set_sync(false); write_options.disable_wal(true); @@ -462,7 +464,7 @@ fn test_no_leaked_column_family() { db.create_cf(&cf_name, &Options::default()).unwrap(); let cf = db.cf_handle(&cf_name).unwrap(); - let mut batch = rocksdb::WriteBatch::default(); + let mut batch = rust_rocksdb::WriteBatch::default(); for key_index in 0..100 { batch.put_cf(&cf, format!("k{key_index}"), &large_blob); } diff --git a/tests/test_comparator.rs b/tests/test_comparator.rs index 7550cdb..efbb2a9 100644 --- a/tests/test_comparator.rs +++ b/tests/test_comparator.rs @@ -1,4 +1,4 @@ -use rocksdb::{Options, DB}; +use rust_rocksdb::{Options, DB}; use std::cmp::Ordering; use std::iter::FromIterator; diff --git a/tests/test_compationfilter.rs b/tests/test_compationfilter.rs index f5e206d..c783116 100644 --- a/tests/test_compationfilter.rs +++ b/tests/test_compationfilter.rs @@ -16,7 +16,7 @@ mod util; use pretty_assertions::assert_eq; -use rocksdb::{CompactionDecision, Options, DB}; +use rust_rocksdb::{CompactionDecision, Options, DB}; use util::DBPath; #[cfg(test)] diff --git a/tests/test_db.rs b/tests/test_db.rs index e7eec0c..2e033ad 100644 --- a/tests/test_db.rs +++ b/tests/test_db.rs @@ -19,7 +19,7 @@ use std::{mem, sync::Arc, thread, time::Duration}; use pretty_assertions::assert_eq; -use rocksdb::{ +use rust_rocksdb::{ perf::get_memory_usage_stats, BlockBasedOptions, BottommostLevelCompaction, Cache, ColumnFamilyDescriptor, CompactOptions, CuckooTableOptions, DBAccess, DBCompactionStyle, DBWithThreadMode, Env, Error, ErrorKind, FifoCompactOptions, IteratorMode, MultiThreaded, @@ -422,7 +422,7 @@ struct OperationCounts { deletes: usize, } -impl rocksdb::WriteBatchIterator for OperationCounts { +impl rust_rocksdb::WriteBatchIterator for OperationCounts { fn put(&mut self, _key: Box<[u8]>, _value: Box<[u8]>) { self.puts += 1; } @@ -877,8 +877,8 @@ fn env_and_dbpaths_test() { { let paths = vec![ - rocksdb::DBPath::new(&path1, 20 << 20).unwrap(), - rocksdb::DBPath::new(&path2, 30 << 20).unwrap(), + rust_rocksdb::DBPath::new(&path1, 20 << 20).unwrap(), + rust_rocksdb::DBPath::new(&path2, 30 << 20).unwrap(), ]; opts.set_db_paths(&paths); } @@ -1509,13 +1509,13 @@ fn test_atomic_flush_cfs() { let cf1 = db.cf_handle("cf1").unwrap(); let cf2 = db.cf_handle("cf2").unwrap(); - let mut write_options = rocksdb::WriteOptions::new(); + let mut write_options = rust_rocksdb::WriteOptions::new(); write_options.disable_wal(true); db.put_cf_opt(&cf1, "k11", "v11", &write_options).unwrap(); db.put_cf_opt(&cf2, "k21", "v21", &write_options).unwrap(); - let mut opts = rocksdb::FlushOptions::new(); + let mut opts = rust_rocksdb::FlushOptions::new(); opts.set_wait(true); db.flush_cfs_opt(&[&cf1, &cf2], &opts).unwrap(); } diff --git a/tests/test_iterator.rs b/tests/test_iterator.rs index 72a40ad..149d4e6 100644 --- a/tests/test_iterator.rs +++ b/tests/test_iterator.rs @@ -16,7 +16,7 @@ mod util; use pretty_assertions::assert_eq; -use rocksdb::{Direction, IteratorMode, MemtableFactory, Options, DB}; +use rust_rocksdb::{Direction, IteratorMode, MemtableFactory, Options, DB}; use util::{assert_iter, assert_iter_reversed, pair, DBPath}; #[test] @@ -120,7 +120,7 @@ fn test_prefix_iterator() { const B1: &[u8] = b"bbb1"; const B2: &[u8] = b"bbb2"; - let prefix_extractor = rocksdb::SliceTransform::create_fixed_prefix(3); + let prefix_extractor = rust_rocksdb::SliceTransform::create_fixed_prefix(3); let mut opts = Options::default(); opts.create_if_missing(true); @@ -162,7 +162,7 @@ fn test_prefix_iterator_uses_full_prefix() { ([2, 2, 2, 2], b"888"), ]; - let prefix_extractor = rocksdb::SliceTransform::create_fixed_prefix(1); + let prefix_extractor = rust_rocksdb::SliceTransform::create_fixed_prefix(1); let mut opts = Options::default(); opts.create_if_missing(true); @@ -194,7 +194,7 @@ fn test_full_iterator() { const B1: &[u8] = b"bbb1"; const B2: &[u8] = b"bbb2"; - let prefix_extractor = rocksdb::SliceTransform::create_fixed_prefix(3); + let prefix_extractor = rust_rocksdb::SliceTransform::create_fixed_prefix(3); let factory = MemtableFactory::HashSkipList { bucket_count: 1_000_000, height: 4, @@ -276,11 +276,11 @@ fn test_iter_range() { fn test( db: &DB, mode: IteratorMode, - range: impl rocksdb::IterateBounds, + range: impl rust_rocksdb::IterateBounds, want: std::ops::Range, reverse: bool, ) { - let mut ro = rocksdb::ReadOptions::default(); + let mut ro = rust_rocksdb::ReadOptions::default(); // Set bounds to test that set_iterate_range clears old bounds. ro.set_iterate_lower_bound(vec![b'z']); ro.set_iterate_upper_bound(vec![b'z']); @@ -297,15 +297,15 @@ fn test_iter_range() { assert_eq!(&ALL_KEYS[want], got); } - fn prefix(key: &[u8]) -> rocksdb::PrefixRange<&[u8]> { - rocksdb::PrefixRange(key) + fn prefix(key: &[u8]) -> rust_rocksdb::PrefixRange<&[u8]> { + rust_rocksdb::PrefixRange(key) } // Test Start and End modes { fn check(db: &DB, range: R, want: std::ops::Range) where - R: rocksdb::IterateBounds + Clone, + R: rust_rocksdb::IterateBounds + Clone, { test(db, IteratorMode::Start, range.clone(), want.clone(), false); test(db, IteratorMode::End, range, want, true); @@ -327,7 +327,7 @@ fn test_iter_range() { { fn check(db: &DB, from: &[u8], range: R, want: std::ops::Range) where - R: rocksdb::IterateBounds + Clone, + R: rust_rocksdb::IterateBounds + Clone, { let mode = IteratorMode::From(from, Direction::Forward); test(db, mode, range, want, false); @@ -355,7 +355,7 @@ fn test_iter_range() { { fn check(db: &DB, from: &[u8], range: R, want: std::ops::Range) where - R: rocksdb::IterateBounds + Clone, + R: rust_rocksdb::IterateBounds + Clone, { let mode = IteratorMode::From(from, Direction::Reverse); test(db, mode, range, want, true); diff --git a/tests/test_merge_operator.rs b/tests/test_merge_operator.rs index 701537f..5d1c279 100644 --- a/tests/test_merge_operator.rs +++ b/tests/test_merge_operator.rs @@ -15,7 +15,7 @@ mod util; use pretty_assertions::assert_eq; -use rocksdb::{merge_operator::MergeFn, DBCompactionStyle, MergeOperands, Options, DB}; +use rust_rocksdb::{merge_operator::MergeFn, DBCompactionStyle, MergeOperands, Options, DB}; use serde::{Deserialize, Serialize}; use util::DBPath; diff --git a/tests/test_multithreaded.rs b/tests/test_multithreaded.rs index db99758..0b82ce5 100644 --- a/tests/test_multithreaded.rs +++ b/tests/test_multithreaded.rs @@ -16,7 +16,7 @@ mod util; use std::{sync::Arc, thread}; -use rocksdb::DB; +use rust_rocksdb::DB; use util::DBPath; const N: usize = 100_000; diff --git a/tests/test_optimistic_transaction_db.rs b/tests/test_optimistic_transaction_db.rs index 61c86de..fe77603 100644 --- a/tests/test_optimistic_transaction_db.rs +++ b/tests/test_optimistic_transaction_db.rs @@ -15,7 +15,7 @@ mod util; -use rocksdb::{ +use rust_rocksdb::{ CuckooTableOptions, DBAccess, Direction, Error, ErrorKind, IteratorMode, OptimisticTransactionDB, OptimisticTransactionOptions, Options, ReadOptions, SingleThreaded, SliceTransform, SnapshotWithThreadMode, WriteBatchWithTransaction, WriteOptions, DB, diff --git a/tests/test_pinnable_slice.rs b/tests/test_pinnable_slice.rs index 279150e..030ccb9 100644 --- a/tests/test_pinnable_slice.rs +++ b/tests/test_pinnable_slice.rs @@ -16,7 +16,7 @@ mod util; use pretty_assertions::assert_eq; -use rocksdb::{Options, DB}; +use rust_rocksdb::{Options, DB}; use util::DBPath; #[test] diff --git a/tests/test_property.rs b/tests/test_property.rs index 9782bd2..d06baf9 100644 --- a/tests/test_property.rs +++ b/tests/test_property.rs @@ -16,7 +16,7 @@ mod util; use pretty_assertions::assert_eq; -use rocksdb::{properties, Options, DB}; +use rust_rocksdb::{properties, Options, DB}; use util::DBPath; #[test] diff --git a/tests/test_raw_iterator.rs b/tests/test_raw_iterator.rs index 442958f..dcb54ac 100644 --- a/tests/test_raw_iterator.rs +++ b/tests/test_raw_iterator.rs @@ -16,7 +16,7 @@ mod util; use pretty_assertions::assert_eq; -use rocksdb::{DBAccess, DBRawIteratorWithThreadMode, DB}; +use rust_rocksdb::{DBAccess, DBRawIteratorWithThreadMode, DB}; use util::DBPath; fn assert_item(iter: &DBRawIteratorWithThreadMode<'_, D>, key: &[u8], value: &[u8]) { diff --git a/tests/test_rocksdb_options.rs b/tests/test_rocksdb_options.rs index bea6568..412ae3d 100644 --- a/tests/test_rocksdb_options.rs +++ b/tests/test_rocksdb_options.rs @@ -16,7 +16,7 @@ mod util; use std::{fs, io::Read as _}; -use rocksdb::{ +use rust_rocksdb::{ BlockBasedOptions, Cache, DBCompressionType, DataBlockIndexType, Env, Options, ReadOptions, DB, }; use util::DBPath; diff --git a/tests/test_slice_transform.rs b/tests/test_slice_transform.rs index afbb248..cdff4d4 100644 --- a/tests/test_slice_transform.rs +++ b/tests/test_slice_transform.rs @@ -16,7 +16,7 @@ mod util; use pretty_assertions::assert_eq; -use rocksdb::{Options, SliceTransform, DB}; +use rust_rocksdb::{Options, SliceTransform, DB}; use util::{assert_iter, pair, DBPath}; #[test] diff --git a/tests/test_sst_file_writer.rs b/tests/test_sst_file_writer.rs index 5376f5a..ead8034 100644 --- a/tests/test_sst_file_writer.rs +++ b/tests/test_sst_file_writer.rs @@ -16,7 +16,7 @@ mod util; use pretty_assertions::assert_eq; -use rocksdb::{Error, Options, SstFileWriter, DB}; +use rust_rocksdb::{Error, Options, SstFileWriter, DB}; use util::DBPath; #[test] diff --git a/tests/test_transaction_db.rs b/tests/test_transaction_db.rs index 901b7ec..d263d37 100644 --- a/tests/test_transaction_db.rs +++ b/tests/test_transaction_db.rs @@ -17,7 +17,7 @@ mod util; use pretty_assertions::assert_eq; -use rocksdb::{ +use rust_rocksdb::{ CuckooTableOptions, DBAccess, Direction, Error, ErrorKind, IteratorMode, Options, ReadOptions, SliceTransform, TransactionDB, TransactionDBOptions, TransactionOptions, WriteBatchWithTransaction, WriteOptions, DB, diff --git a/tests/test_write_batch.rs b/tests/test_write_batch.rs index 28ea265..2020e4b 100644 --- a/tests/test_write_batch.rs +++ b/tests/test_write_batch.rs @@ -16,7 +16,7 @@ use std::collections::HashMap; use pretty_assertions::assert_eq; -use rocksdb::{WriteBatch, WriteBatchIterator}; +use rust_rocksdb::{WriteBatch, WriteBatchIterator}; #[test] fn test_write_batch_clear() { diff --git a/tests/util/mod.rs b/tests/util/mod.rs index 6a077e8..a758dc4 100644 --- a/tests/util/mod.rs +++ b/tests/util/mod.rs @@ -2,7 +2,7 @@ use std::path::{Path, PathBuf}; -use rocksdb::{Error, Options, DB}; +use rust_rocksdb::{Error, Options, DB}; /// Temporary database path which calls DB::Destroy when DBPath is dropped. pub struct DBPath {