Drop the per-core store for `id` and best-effort remove the on-disk segment directory. Called by the `DropArray` dispatch handler during `DROP ARRAY` broadcast so a follow-up `CREATE ARRAY` of the same name (potentially with a different schema) doesn't carry stale memtable / segment state. Idempotent: returns `Ok(())` when no store is open and no directory exists. Directory-removal errors are sur
(&mut self, id: &ArrayId)
| 141 | /// `ArrayEngineError::Io` so the broadcast's status reflects the |
| 142 | /// failure. |
| 143 | pub fn drop_array(&mut self, id: &ArrayId) -> ArrayEngineResult<()> { |
| 144 | let _ = self.arrays.remove(id); |
| 145 | let dir = array_dir(&self.cfg.root, id); |
| 146 | if dir.exists() { |
| 147 | std::fs::remove_dir_all(&dir).map_err(|e| ArrayEngineError::Io { |
| 148 | detail: format!("rmdir {dir:?}: {e}"), |
| 149 | })?; |
| 150 | } |
| 151 | Ok(()) |
| 152 | } |
| 153 | |
| 154 | pub fn store(&self, id: &ArrayId) -> ArrayEngineResult<&ArrayStore> { |
| 155 | self.arrays |
no test coverage detected