(lock_key: &str)
| 475 | } |
| 476 | |
| 477 | fn table_access_lock_path(lock_key: &str) -> PathBuf { |
| 478 | let mut hasher = DefaultHasher::new(); |
| 479 | lock_key.hash(&mut hasher); |
| 480 | let hash = hasher.finish(); |
| 481 | let label = lock_key |
| 482 | .rsplit('/') |
| 483 | .next() |
| 484 | .unwrap_or(lock_key) |
| 485 | .trim_end_matches(".lance") |
| 486 | .chars() |
| 487 | .map(|ch| if ch.is_ascii_alphanumeric() || matches!(ch, '-' | '_') { ch } else { '_' }) |
| 488 | .collect::<String>(); |
| 489 | let label = if label.is_empty() { "table" } else { label.as_str() }; |
| 490 | std::env::temp_dir() |
| 491 | .join("staticflow-table-locks") |
| 492 | .join(format!("{label}-{hash:016x}.lock")) |
| 493 | } |
| 494 | |
| 495 | async fn prune_table_versions_with_recovery( |
| 496 | table: &Table, |
no test coverage detected