From 4e76f008f83bceebe7ff0b6bd9fd8a72b78254e1 Mon Sep 17 00:00:00 2001 From: ghassmo Date: Sat, 9 Oct 2021 08:53:10 +0300 Subject: [PATCH] slabstore: add debug messages --- src/blockchain/slabstore.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/blockchain/slabstore.rs b/src/blockchain/slabstore.rs index 92e04b30b..bb6d14d42 100644 --- a/src/blockchain/slabstore.rs +++ b/src/blockchain/slabstore.rs @@ -1,11 +1,14 @@ use std::sync::Arc; +use log::debug; + use crate::serial::{deserialize, serialize}; use crate::Result; use super::rocks::{columns, IteratorMode, RocksColumn}; use super::slab::Slab; + pub struct SlabStore { rocks: RocksColumn, } @@ -16,11 +19,13 @@ impl SlabStore { } pub fn get(&self, key: Vec) -> Result>> { + debug!(target: "SLABSTORE", "get value"); let value = self.rocks.get(key)?; Ok(value) } pub fn put(&self, slab: Slab) -> Result> { + debug!(target: "SLABSTORE", "Put slab"); let last_index = self.get_last_index()?; let key = last_index + 1; @@ -37,6 +42,7 @@ impl SlabStore { } pub fn get_last_index(&self) -> Result { + debug!(target: "SLABSTORE", "Get last index"); let last_index = self.rocks.iterator(IteratorMode::End)?.next(); match last_index { Some((index, _)) => Ok(deserialize(&index)?), @@ -45,6 +51,7 @@ impl SlabStore { } pub fn get_last_index_as_bytes(&self) -> Result> { + debug!(target: "SLABSTORE", "Get last index as bytes"); let last_index = self.rocks.iterator(IteratorMode::End)?.next(); match last_index { Some((index, _)) => Ok(index.to_vec()),