diff options
Diffstat (limited to 'tvix')
-rw-r--r-- | tvix/store/src/bin/tvix-store.rs | 4 | ||||
-rw-r--r-- | tvix/store/src/import.rs | 13 | ||||
-rw-r--r-- | tvix/store/src/tests/import.rs | 8 |
3 files changed, 13 insertions, 12 deletions
diff --git a/tvix/store/src/bin/tvix-store.rs b/tvix/store/src/bin/tvix-store.rs index 29f8a92cb1be..807cc07643d1 100644 --- a/tvix/store/src/bin/tvix-store.rs +++ b/tvix/store/src/bin/tvix-store.rs @@ -9,7 +9,7 @@ use std::path::PathBuf; use tracing_subscriber::prelude::*; use tvix_store::blobservice::SledBlobService; use tvix_store::directoryservice::SledDirectoryService; -use tvix_store::import::import_path; +use tvix_store::import::ingest_path; use tvix_store::nar::NARCalculationService; use tvix_store::nar::NonCachingNARCalculationService; use tvix_store::pathinfoservice::SledPathInfoService; @@ -135,7 +135,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { ); for path in paths { - let root_node = import_path(&mut blob_service, &mut directory_service, &path)?; + let root_node = ingest_path(&mut blob_service, &mut directory_service, &path)?; let nar_hash = NixHashWithMode::Recursive(NixHash::new( HashAlgo::Sha256, diff --git a/tvix/store/src/import.rs b/tvix/store/src/import.rs index bf80eb4b71b9..ade700a6c283 100644 --- a/tvix/store/src/import.rs +++ b/tvix/store/src/import.rs @@ -136,14 +136,15 @@ fn process_entry<BS: BlobService, DP: DirectoryPutter>( todo!("handle other types") } -/// Imports the contents at a given Path into the tvix store. +/// Ingests the contents at the given path into the tvix store, +/// interacting with a [BlobService] and [DirectoryService]. +/// It returns the root node or an error. /// -/// It doesn't register the contents at a Path in the store itself, that's up -/// to the PathInfoService. -// -// returns the root node, or an error. +/// It's not interacting with a [PathInfoService], it's up to the caller to +/// possibly register it somewhere (and potentially rename it based on some +/// naming scheme. #[instrument(skip(blob_service, directory_service), fields(path=?p))] -pub fn import_path<BS: BlobService, DS: DirectoryService, P: AsRef<Path> + Debug>( +pub fn ingest_path<BS: BlobService, DS: DirectoryService, P: AsRef<Path> + Debug>( blob_service: &mut BS, directory_service: &mut DS, p: P, diff --git a/tvix/store/src/tests/import.rs b/tvix/store/src/tests/import.rs index ed5154d6fec0..ef4ef74d09f7 100644 --- a/tvix/store/src/tests/import.rs +++ b/tvix/store/src/tests/import.rs @@ -1,7 +1,7 @@ use super::utils::{gen_blob_service, gen_directory_service}; use crate::blobservice::BlobService; use crate::directoryservice::DirectoryService; -use crate::import::import_path; +use crate::import::ingest_path; use crate::proto; use crate::tests::fixtures::DIRECTORY_COMPLICATED; use crate::tests::fixtures::*; @@ -19,7 +19,7 @@ fn symlink() { ) .unwrap(); - let root_node = import_path( + let root_node = ingest_path( &mut gen_blob_service(), &mut gen_directory_service(), tmpdir.path().join("doesntmatter"), @@ -43,7 +43,7 @@ fn single_file() { let mut blob_service = gen_blob_service(); - let root_node = import_path( + let root_node = ingest_path( &mut blob_service, &mut gen_directory_service(), tmpdir.path().join("root"), @@ -82,7 +82,7 @@ fn complicated() { let mut blob_service = gen_blob_service(); let mut directory_service = gen_directory_service(); - let root_node = import_path(&mut blob_service, &mut directory_service, tmpdir.path()) + let root_node = ingest_path(&mut blob_service, &mut directory_service, tmpdir.path()) .expect("must succeed"); // ensure root_node matched expectations |