(
dim_bufman: &BufferManager,
data_bufmans: &BufferManagerFactory<VersionNumber>,
file_offset: FileOffset,
_version: VersionNumber,
cache: &InvertedIndexCache,
| 38 | } |
| 39 | |
| 40 | fn deserialize( |
| 41 | dim_bufman: &BufferManager, |
| 42 | data_bufmans: &BufferManagerFactory<VersionNumber>, |
| 43 | file_offset: FileOffset, |
| 44 | _version: VersionNumber, |
| 45 | cache: &InvertedIndexCache, |
| 46 | ) -> Result<Self, BufIoError> { |
| 47 | let cursor = dim_bufman.open_cursor()?; |
| 48 | dim_bufman.seek_with_cursor(cursor, file_offset.0 as u64 - 1)?; |
| 49 | let quantization_and_implicit = dim_bufman.read_u8_with_cursor(cursor)?; |
| 50 | let quantization_bits = (quantization_and_implicit << 1) >> 1; |
| 51 | let max_key = ((1u32 << quantization_bits) - 1) as u8; |
| 52 | |
| 53 | let map = TSHashTable::new(16); |
| 54 | for i in 0..=max_key { |
| 55 | let offset = dim_bufman.read_u32_with_cursor(cursor)?; |
| 56 | let version = dim_bufman.read_u32_with_cursor(cursor)?; |
| 57 | if offset == u32::MAX { |
| 58 | continue; |
| 59 | } |
| 60 | let pool = VersionedVec::deserialize( |
| 61 | dim_bufman, |
| 62 | data_bufmans, |
| 63 | FileOffset(offset), |
| 64 | VersionNumber::from(version), |
| 65 | cache, |
| 66 | )?; |
| 67 | map.insert(i, pool); |
| 68 | } |
| 69 | dim_bufman.close_cursor(cursor)?; |
| 70 | Ok(Self { map, max_key }) |
| 71 | } |
| 72 | } |
nothing calls this directly
no test coverage detected