mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-08-12 09:19:39 +00:00
sstable compression (#1946)
* compress sstable with zstd * add some details to sstable readme * compress only block which benefit from it * multiple changes to sstable make compression optional use OwnedBytes instead of impl Read in sstable, required for next point use zstd bulk api, which is much faster on small records * cleanup and use bulk api for compression * use dedicated byte for compression * switch block len and compression flag * change default zstd level in sstable
This commit is contained in:
@@ -139,6 +139,16 @@ impl OwnedBytes {
|
||||
self.advance(8);
|
||||
u64::from_le_bytes(octlet)
|
||||
}
|
||||
|
||||
/// Reads an `u32` encoded as little-endian from the `OwnedBytes` and advance by 4 bytes.
|
||||
#[inline]
|
||||
pub fn read_u32(&mut self) -> u32 {
|
||||
assert!(self.len() > 3);
|
||||
|
||||
let quad: [u8; 4] = self.as_slice()[..4].try_into().unwrap();
|
||||
self.advance(4);
|
||||
u32::from_le_bytes(quad)
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for OwnedBytes {
|
||||
|
||||
Reference in New Issue
Block a user