Add code comment for get_slot_meta_entry in blockstore.rs (#21844)
This commit is contained in:
committed by
GitHub
parent
5fb7da12f2
commit
e374fb1d60
@ -3268,6 +3268,24 @@ fn get_index_meta_entry<'a>(
|
|||||||
res
|
res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Obtain the SlotMeta from the in-memory slot_meta_working_set or load
|
||||||
|
/// it from the database if it does not exist in slot_meta_working_set.
|
||||||
|
///
|
||||||
|
/// In case none of the above has the specified SlotMeta, a new one will
|
||||||
|
/// be created.
|
||||||
|
///
|
||||||
|
/// Note that this function will also update the parent slot of the specified
|
||||||
|
/// slot.
|
||||||
|
///
|
||||||
|
/// Arguments:
|
||||||
|
/// - `db`: the database
|
||||||
|
/// - `slot_meta_working_set`: a in-memory structure for storing the cached
|
||||||
|
/// SlotMeta.
|
||||||
|
/// - `slot`: the slot for loading its meta.
|
||||||
|
/// - `parent_slot`: the parent slot to be assigned to the specified slot meta
|
||||||
|
///
|
||||||
|
/// This function returns the matched `SlotMetaWorkingSetEntry`. If such entry
|
||||||
|
/// does not exist in the database, a new entry will be created.
|
||||||
fn get_slot_meta_entry<'a>(
|
fn get_slot_meta_entry<'a>(
|
||||||
db: &Database,
|
db: &Database,
|
||||||
slot_meta_working_set: &'a mut HashMap<u64, SlotMetaWorkingSetEntry>,
|
slot_meta_working_set: &'a mut HashMap<u64, SlotMetaWorkingSetEntry>,
|
||||||
|
Reference in New Issue
Block a user