Skip to content

Commit

Permalink
update code imports after package name change and clean up README/MAI…
Browse files Browse the repository at this point in the history
…NTAINERHSIP
  • Loading branch information
zaidoon1 committed Feb 10, 2024
1 parent 470617e commit c777b3b
Show file tree
Hide file tree
Showing 21 changed files with 42 additions and 44 deletions.
4 changes: 1 addition & 3 deletions MAINTAINERSHIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
rust-rocksdb
============

[![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/zaidoon1/rust-rocksdb/blob/master/LICENSE)
![rust 1.75.0 required](https://img.shields.io/badge/rust-1.75.0-blue.svg?label=MSRV)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_backup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mod util;

use pretty_assertions::assert_eq;

use rocksdb::{
use rust_rocksdb::{
backup::{BackupEngine, BackupEngineOptions, RestoreOptions},
Env, DB,
};
Expand Down
2 changes: 1 addition & 1 deletion tests/test_checkpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
14 changes: 8 additions & 6 deletions tests/test_column_family.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,20 @@ 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;
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<Path>) -> io::Result<u64> {
fn dir_size(mut dir: fs::ReadDir) -> io::Result<u64> {
Expand Down Expand Up @@ -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);

Expand All @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_comparator.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use rocksdb::{Options, DB};
use rust_rocksdb::{Options, DB};
use std::cmp::Ordering;
use std::iter::FromIterator;

Expand Down
2 changes: 1 addition & 1 deletion tests/test_compationfilter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
12 changes: 6 additions & 6 deletions tests/test_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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();
}
Expand Down
22 changes: 11 additions & 11 deletions tests/test_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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<usize>,
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']);
Expand All @@ -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<R>(db: &DB, range: R, want: std::ops::Range<usize>)
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);
Expand All @@ -327,7 +327,7 @@ fn test_iter_range() {
{
fn check<R>(db: &DB, from: &[u8], range: R, want: std::ops::Range<usize>)
where
R: rocksdb::IterateBounds + Clone,
R: rust_rocksdb::IterateBounds + Clone,
{
let mode = IteratorMode::From(from, Direction::Forward);
test(db, mode, range, want, false);
Expand Down Expand Up @@ -355,7 +355,7 @@ fn test_iter_range() {
{
fn check<R>(db: &DB, from: &[u8], range: R, want: std::ops::Range<usize>)
where
R: rocksdb::IterateBounds + Clone,
R: rust_rocksdb::IterateBounds + Clone,
{
let mode = IteratorMode::From(from, Direction::Reverse);
test(db, mode, range, want, true);
Expand Down
2 changes: 1 addition & 1 deletion tests/test_merge_operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion tests/test_multithreaded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/test_optimistic_transaction_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pinnable_slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mod util;

use pretty_assertions::assert_eq;

use rocksdb::{Options, DB};
use rust_rocksdb::{Options, DB};
use util::DBPath;

#[test]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_property.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_raw_iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<D: DBAccess>(iter: &DBRawIteratorWithThreadMode<'_, D>, key: &[u8], value: &[u8]) {
Expand Down
2 changes: 1 addition & 1 deletion tests/test_rocksdb_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/test_slice_transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_sst_file_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_transaction_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_write_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion tests/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit c777b3b

Please sign in to comment.