MCPcopy Create free account
hub / github.com/apache/datafusion / create_local_dirs

Function create_local_dirs

datafusion/execution/src/disk_manager.rs:460–474  ·  view source on GitHub ↗

Setup local dirs by creating one new dir in each of the given dirs

(local_dirs: &[PathBuf])

Source from the content-addressed store, hash-verified

458
459/// Setup local dirs by creating one new dir in each of the given dirs
460fn create_local_dirs(local_dirs: &[PathBuf]) -> Result<Vec<Arc<TempDir>>> {
461 local_dirs
462 .iter()
463 .map(|root| {
464 if !Path::new(root).exists() {
465 std::fs::create_dir(root)?;
466 }
467 Builder::new()
468 .prefix("datafusion-")
469 .tempdir_in(root)
470 .map_err(DataFusionError::IoError)
471 })
472 .map(|result| result.map(Arc::new))
473 .collect()
474}
475
476#[cfg(test)]
477mod tests {

Callers 2

buildMethod · 0.85
try_newMethod · 0.85

Calls 6

newFunction · 0.85
collectMethod · 0.80
existsMethod · 0.80
prefixMethod · 0.80
mapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…