From 202c7c57fde4ba08360d05d448f499ef8abb6701 Mon Sep 17 00:00:00 2001 From: Olivier 'reivilibre Date: Sat, 20 Nov 2021 11:23:17 +0000 Subject: [PATCH] Make store_worker generic over chunk submission target --- yama/src/operations/storing.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yama/src/operations/storing.rs b/yama/src/operations/storing.rs index ba63a49..3e0b380 100644 --- a/yama/src/operations/storing.rs +++ b/yama/src/operations/storing.rs @@ -26,7 +26,7 @@ use crossbeam_channel::{Receiver, Sender}; use crossbeam_utils::thread; use log::{error, warn}; -use crate::chunking::{RecursiveChunker, SENSIBLE_THRESHOLD}; +use crate::chunking::{ChunkSubmissionTarget, RecursiveChunker, SENSIBLE_THRESHOLD}; use crate::commands; use crate::commands::{fully_integrate_pointer_node, retrieve_tree_node}; use crate::definitions::{PointerData, RecursiveChunkRef, RootTreeNode, TreeNode}; @@ -83,9 +83,9 @@ pub fn store( } } -pub fn store_worker( +pub fn store_worker( root: &Path, - pile: &Pile, + target: &CST, paths: Receiver, results: Sender<(String, Option)>, ) -> anyhow::Result<()> { @@ -93,7 +93,7 @@ pub fn store_worker( let full_path = root.join(&path); match File::open(&full_path) { Ok(mut file) => { - let mut chunker = RecursiveChunker::new(SENSIBLE_THRESHOLD, pile); + let mut chunker = RecursiveChunker::new(SENSIBLE_THRESHOLD, target); // streaming copy from file to chunker, really cool :) io::copy(&mut file, &mut chunker)?; let chunk_ref = chunker.finish()?;