Load `change_id`'s spans into the in-memory index on first access.
(&self, change_id: u64)
| 1941 | |
| 1942 | /// Load `change_id`'s spans into the in-memory index on first access. |
| 1943 | fn ensure_span_index(&self, change_id: u64) -> PristineResult<()> { |
| 1944 | if self.span_index.lock().unwrap().contains_change(change_id) { |
| 1945 | return Ok(()); |
| 1946 | } |
| 1947 | let start_key = encode_vertex(change_id, 0, 0); |
| 1948 | let end_key = encode_vertex(change_id, u64::MAX, u64::MAX); |
| 1949 | let mut set = std::collections::BTreeSet::new(); |
| 1950 | for result in self.graph_table.range::<&[u8; 24]>(&start_key..=&end_key)? { |
| 1951 | let (key, _values) = result?; |
| 1952 | let (v_change, v_start, v_end) = decode_vertex(key.value()); |
| 1953 | if v_change != change_id { |
| 1954 | continue; |
| 1955 | } |
| 1956 | set.insert((v_start, v_end)); |
| 1957 | } |
| 1958 | self.span_index |
| 1959 | .lock() |
| 1960 | .unwrap() |
| 1961 | .insert_change(change_id, set); |
| 1962 | Ok(()) |
| 1963 | } |
| 1964 | } |
| 1965 | |
| 1966 | impl PathClaimTxnT for CachedGraphTxn<'_> { |
no test coverage detected