feat: add analyze-storage command to ledger-tool (#7165)

This commit is contained in:
Sunny Gleason
2019-12-12 18:54:50 -05:00
committed by GitHub
parent 1d172b07a8
commit 115bf2613d
6 changed files with 123 additions and 1 deletions

View File

@ -148,6 +148,10 @@ impl BlocktreeInsertionMetrics {
}
impl Blocktree {
pub fn db(self) -> Arc<Database> {
self.db
}
/// Opens a Ledger in directory, provides "infinite" window of shreds
pub fn open(ledger_path: &Path) -> Result<Blocktree> {
fs::create_dir_all(&ledger_path)?;

View File

@ -228,6 +228,10 @@ pub trait Column {
const NAME: &'static str;
type Index;
fn key_size() -> usize {
std::mem::size_of::<Self::Index>()
}
fn key(index: Self::Index) -> Vec<u8>;
fn index(key: &[u8]) -> Self::Index;
fn slot(index: Self::Index) -> Slot;

View File

@ -3,7 +3,7 @@ pub mod bank_forks_utils;
pub mod block_error;
#[macro_use]
pub mod blocktree;
mod blocktree_db;
pub mod blocktree_db;
mod blocktree_meta;
pub mod blocktree_processor;
pub mod entry;