(Ledger Store) Add code comments for SlotMetaWorkingSetEntry. (#22662)

This commit is contained in:
Yueh-Hsuan Chiang 2022-02-11 10:04:26 -08:00 committed by GitHub
parent 78089941ff
commit 6399647e64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 2 deletions

View File

@ -202,11 +202,18 @@ pub struct IndexMetaWorkingSetEntry {
did_insert_occur: bool,
}
/// The in-memory data structure for updating entries in the column family
/// [`cf::SlotMeta`].
pub struct SlotMetaWorkingSetEntry {
/// The dirty version of the `SlotMeta` which might not be persisted
/// to the blockstore yet.
new_slot_meta: Rc<RefCell<SlotMeta>>,
/// The latest version of the `SlotMeta` that was persisted in the
/// blockstore. If None, it means the current slot is new to the
/// blockstore.
old_slot_meta: Option<SlotMeta>,
// True only if at least one shred for this SlotMeta was inserted since the time this
// struct was created.
/// True only if at least one shred for this SlotMeta was inserted since
/// this struct was created.
did_insert_occur: bool,
}
@ -246,6 +253,8 @@ pub struct BlockstoreInsertionMetrics {
}
impl SlotMetaWorkingSetEntry {
/// Construct a new SlotMetaWorkingSetEntry with the specified `new_slot_meta`
/// and `old_slot_meta`. `did_insert_occur` is set to false.
fn new(new_slot_meta: Rc<RefCell<SlotMeta>>, old_slot_meta: Option<SlotMeta>) -> Self {
Self {
new_slot_meta,