Skip to content

Commit

Permalink
disable printing debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
ogabrielides committed Jun 5, 2024
1 parent 0e94059 commit cffdd65
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
16 changes: 1 addition & 15 deletions grovedb/src/replication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ impl GroveDb {
));
}

println!(" starting:{:?}...", util_path_to_string(&[]));
//println!(" starting:{:?}...", util_path_to_string(&[]));

let root_prefix = [0u8; 32];

Expand All @@ -237,20 +237,6 @@ impl GroveDb {
}
}

// Converts a path into a human-readable string (for debugging)
pub fn util_path_to_string(path: &[Vec<u8>]) -> Vec<String> {
let mut subtree_path_str: Vec<String> = vec![];
for subtree in path {
let string = std::str::from_utf8(subtree).expect("should be able to convert path");
subtree_path_str.push(
string
.parse()
.expect("should be able to parse path to string"),
);
}
subtree_path_str
}

// Splits the given global chunk id into [SUBTREE_PREFIX:CHUNK_ID]
pub fn util_split_global_chunk_id(
global_chunk_id: &[u8],
Expand Down
10 changes: 6 additions & 4 deletions grovedb/src/replication/state_sync_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use grovedb_path::SubtreePath;
use grovedb_storage::rocksdb_storage::PrefixedRocksDbImmediateStorageContext;

use super::{util_decode_vec_ops, util_split_global_chunk_id, CURRENT_STATE_SYNC_VERSION};
use crate::{replication::util_path_to_string, Error, GroveDb, Transaction};
use crate::{Error, GroveDb, Transaction};

pub(crate) type SubtreePrefix = [u8; blake3::OUT_LEN];

Expand Down Expand Up @@ -279,10 +279,10 @@ impl<'db> MultiStateSyncSession<'db> {
let subtree_path: Vec<&[u8]> =
current_path.iter().map(|vec| vec.as_slice()).collect();
let path: &[&[u8]] = &subtree_path;
println!(
/*println!(
" path:{:?} starting...",
util_path_to_string(&prefix_metadata.0)
);
);*/

self.add_subtree_sync_info(
db,
Expand Down Expand Up @@ -367,13 +367,15 @@ impl fmt::Debug for SubtreesMetadata {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
for (prefix, metadata) in self.data.iter() {
let metadata_path = &metadata.0;
let metadata_path_str = util_path_to_string(metadata_path);
/*let metadata_path_str = util_path_to_string(metadata_path);
writeln!(
f,
" prefix:{:?} -> path:{:?}",
hex::encode(prefix),
metadata_path_str
)?;
*/
}
Ok(())
}
Expand Down

0 comments on commit cffdd65

Please sign in to comment.