Skip to main content

recreate_segment

Function recreate_segment 

Source
pub async fn recreate_segment<Block, CI, EBO>(
    last_segment_header: Option<SegmentHeader>,
    chain_info: &CI,
    erasure_coding: ErasureCoding,
    super_segment_details: &RecreateSegmentSuperSegmentDetails,
    extract_block_objects: EBO,
) -> Result<Option<NewArchivedSegment>, RecreateSegmentError>
where Block: GenericOwnedBlock, CI: ChainInfo<Block>, EBO: FnMut(&Block) -> Vec<BlockObject>,
Expand description

Re-create a segment on demand.

last_segment_header corresponds to the last segment before the segment being re-created and indicates where segment archiving should start.

extract_block_objects allows extracting objects stored in blocks to translate them into global objects.

Returns Ok(None) if one of the segment blocks is already pruned.