MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / segment_compressor

Function segment_compressor

crates/commitlog/src/repo/mod.rs:444–448  ·  view source on GitHub ↗

Obtain the canonical [CompressOnce] compressor for segments. The compressor will create seekable [Zstd] archives with a max frame size of 4KiB. That is, seeking to an arbitrary byte offset (of the uncompressed segment) within the archive will decompress 4KiB of data on average.

()

Source from the content-addressed store, hash-verified

442/// of 4KiB. That is, seeking to an arbitrary byte offset (of the uncompressed
443/// segment) within the archive will decompress 4KiB of data on average.
444pub fn segment_compressor() -> Zstd {
445 Zstd {
446 max_frame_size: Some(0x1000),
447 }
448}
449
450fn segment_label<R: Repo>(repo: &R, offset: u64) -> String {
451 repo.segment_file_path(offset)

Callers 1

compress_segmentMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…