Bulk insert entries for a newly flushed segment. `pk_bytes_list` contains the encoded PK bytes for each row in the segment (in order). `segment_id` is the new segment's ID.
(
&mut self,
segment_id: u64,
pk_bytes_list: &[Vec<u8>],
)
| 120 | /// `pk_bytes_list` contains the encoded PK bytes for each row in the segment |
| 121 | /// (in order). `segment_id` is the new segment's ID. |
| 122 | pub fn bulk_insert( |
| 123 | &mut self, |
| 124 | segment_id: u64, |
| 125 | pk_bytes_list: &[Vec<u8>], |
| 126 | ) -> Result<(), ColumnarError> { |
| 127 | for (row_index, pk_bytes) in pk_bytes_list.iter().enumerate() { |
| 128 | let location = RowLocation { |
| 129 | segment_id, |
| 130 | row_index: row_index as u32, |
| 131 | }; |
| 132 | self.insert(pk_bytes.clone(), location)?; |
| 133 | } |
| 134 | Ok(()) |
| 135 | } |
| 136 | |
| 137 | /// Remove all entries pointing to a given segment (used when dropping a segment). |
| 138 | pub fn remove_segment(&mut self, segment_id: u64) { |