Deserialize the index from a checkpoint.
(data: &[u8])
| 148 | |
| 149 | /// Deserialize the index from a checkpoint. |
| 150 | pub fn from_bytes(data: &[u8]) -> Result<Self, ColumnarError> { |
| 151 | let entries: Vec<(Vec<u8>, RowLocation)> = |
| 152 | zerompk::from_msgpack(data).map_err(|e| ColumnarError::Serialization(e.to_string()))?; |
| 153 | let mut inner = BTreeMap::new(); |
| 154 | for (key, loc) in entries { |
| 155 | inner.insert(key, loc); |
| 156 | } |
| 157 | Ok(Self { inner }) |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | impl Default for PkIndex { |