Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump rust-rocksdb to 0.19.0 tag (backport #26949) #27085

Merged
merged 1 commit into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 14 additions & 62 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ledger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ trees = "0.4.2"
[dependencies.rocksdb]
# Avoid the vendored bzip2 within rocksdb-sys that can cause linker conflicts
# when also using the bzip2 crate
version = "0.18.0"
version = "0.19.0"
default-features = false
features = ["lz4"]

Expand Down
14 changes: 10 additions & 4 deletions ledger/src/blockstore_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ impl Rocks {
///
/// Full list of properties that return int values could be found
/// [here](https://github.com/facebook/rocksdb/blob/08809f5e6cd9cc4bc3958dd4d59457ae78c76660/include/rocksdb/db.h#L654-L689).
fn get_int_property_cf(&self, cf: &ColumnFamily, name: &str) -> Result<i64> {
fn get_int_property_cf(&self, cf: &ColumnFamily, name: &'static std::ffi::CStr) -> Result<i64> {
match self.db.property_int_value_cf(cf, name) {
Ok(Some(value)) => Ok(value.try_into().unwrap()),
Ok(None) => Ok(0),
Expand Down Expand Up @@ -1059,7 +1059,10 @@ impl Database {
{
let cf = self.cf_handle::<C>();
let iter = self.backend.iterator_cf::<C>(cf, iterator_mode);
Ok(iter.map(|(key, value)| (C::index(&key), value)))
Ok(iter.map(|pair| {
let (key, value) = pair.unwrap();
(C::index(&key), value)
}))
}

#[inline]
Expand Down Expand Up @@ -1153,7 +1156,10 @@ where
) -> Result<impl Iterator<Item = (C::Index, Box<[u8]>)> + '_> {
let cf = self.handle();
let iter = self.backend.iterator_cf::<C>(cf, iterator_mode);
Ok(iter.map(|(key, value)| (C::index(&key), value)))
Ok(iter.map(|pair| {
let (key, value) = pair.unwrap();
(C::index(&key), value)
}))
}

pub fn delete_slot(
Expand Down Expand Up @@ -1235,7 +1241,7 @@ where
///
/// Full list of properties that return int values could be found
/// [here](https://github.com/facebook/rocksdb/blob/08809f5e6cd9cc4bc3958dd4d59457ae78c76660/include/rocksdb/db.h#L654-L689).
pub fn get_int_property(&self, name: &str) -> Result<i64> {
pub fn get_int_property(&self, name: &'static std::ffi::CStr) -> Result<i64> {
self.backend.get_int_property_cf(self.handle(), name)
}
}
Expand Down
12 changes: 6 additions & 6 deletions programs/bpf/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.