From aaae5b3ba6696c75fe7f6ee6f3840e8461a5165c Mon Sep 17 00:00:00 2001
From: Yueh-Hsuan Chiang <93241502+yhchiang-sol@users.noreply.github.com>
Date: Sat, 29 Jan 2022 01:25:07 -0500
Subject: [PATCH] (Ledger Store) Add comment blocks for six pub functions in
blockstore.rs (#22476)
---
ledger/src/blockstore.rs | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/ledger/src/blockstore.rs b/ledger/src/blockstore.rs
index c5733d6a34..e97f005d32 100644
--- a/ledger/src/blockstore.rs
+++ b/ledger/src/blockstore.rs
@@ -516,10 +516,19 @@ impl Blockstore {
}
}
+ /// Whether to disable compaction in [`compact_storage`], which is used
+ /// by the ledger cleanup service and [`backup_and_clear_blockstore`].
+ ///
+ /// Note that this setting is not related to the RocksDB's background
+ /// compaction.
+ ///
+ /// To disable RocksDB's background compaction, open the Blockstore
+ /// with AccessType::PrimaryOnlyForMaintenance.
pub fn set_no_compaction(&mut self, no_compaction: bool) {
self.no_compaction = no_compaction;
}
+ /// Deletes the blockstore at the specified path.
pub fn destroy(ledger_path: &Path) -> Result<()> {
// Database::destroy() fails if the path doesn't exist
fs::create_dir_all(ledger_path)?;
@@ -527,10 +536,12 @@ impl Blockstore {
Database::destroy(&blockstore_path)
}
+ /// Returns the SlotMeta of the specified slot.
pub fn meta(&self, slot: Slot) -> Result