Skip to content

Commit

Permalink
Bump rust-rocksdb to 0.19.0 tag (solana-labs#26949)
Browse files Browse the repository at this point in the history
  • Loading branch information
steviez authored Aug 11, 2022
1 parent 7e7785f commit 14d9922
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 73 deletions.
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 @@ -519,7 +519,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 @@ -1069,7 +1069,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 @@ -1174,7 +1177,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 @@ -1256,7 +1262,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.

0 comments on commit 14d9922

Please sign in to comment.