Skip to content

Commit

Permalink
Add LedgerColumn::get_raw
Browse files Browse the repository at this point in the history
  • Loading branch information
CriesofCarrots committed Oct 6, 2023
1 parent f848af0 commit 0afd1b8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ledger/src/blockstore_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1612,12 +1612,16 @@ where
}

pub fn get(&self, key: C::Index) -> Result<Option<C::Type>> {
self.get_raw(&C::key(key))
}

pub fn get_raw(&self, key: &[u8]) -> Result<Option<C::Type>> {
let mut result = Ok(None);
let is_perf_enabled = maybe_enable_rocksdb_perf(
self.column_options.rocks_perf_sample_interval,
&self.read_perf_status,
);
if let Some(pinnable_slice) = self.backend.get_pinned_cf(self.handle(), &C::key(key))? {
if let Some(pinnable_slice) = self.backend.get_pinned_cf(self.handle(), key)? {
let value = deserialize(pinnable_slice.as_ref())?;
result = Ok(Some(value))
}
Expand Down

0 comments on commit 0afd1b8

Please sign in to comment.