This commit is contained in:
		
							parent
							
								
									155d31626e
								
							
						
					
					
						commit
						8eeafa7626
					
				
							
								
								
									
										4
									
								
								Cargo.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										4
									
								
								Cargo.lock
									
									
									
										generated
									
									
									
								
							| @ -258,7 +258,7 @@ dependencies = [ | |||||||
| 
 | 
 | ||||||
| [[package]] | [[package]] | ||||||
| name = "datman" | name = "datman" | ||||||
| version = "0.5.0-alpha.1" | version = "0.5.0-alpha.2" | ||||||
| dependencies = [ | dependencies = [ | ||||||
|  "anyhow", |  "anyhow", | ||||||
|  "arc-interner", |  "arc-interner", | ||||||
| @ -1218,7 +1218,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" | |||||||
| 
 | 
 | ||||||
| [[package]] | [[package]] | ||||||
| name = "yama" | name = "yama" | ||||||
| version = "0.5.0-alpha.1" | version = "0.5.0-alpha.2" | ||||||
| dependencies = [ | dependencies = [ | ||||||
|  "anyhow", |  "anyhow", | ||||||
|  "blake", |  "blake", | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
| [package] | [package] | ||||||
| name = "datman" | name = "datman" | ||||||
| version = "0.5.0-alpha.1" | version = "0.5.0-alpha.2" | ||||||
| authors = ["Olivier 'reivilibre' <olivier@librepush.net>"] | authors = ["Olivier 'reivilibre' <olivier@librepush.net>"] | ||||||
| edition = "2018" | edition = "2018" | ||||||
| repository = "https://bics.ga/reivilibre/yama" | repository = "https://bics.ga/reivilibre/yama" | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
| [package] | [package] | ||||||
| name = "yama" | name = "yama" | ||||||
| version = "0.5.0-alpha.1" | version = "0.5.0-alpha.2" | ||||||
| authors = ["Olivier 'reivilibre' <olivier@librepush.net>"] | authors = ["Olivier 'reivilibre' <olivier@librepush.net>"] | ||||||
| edition = "2018" | edition = "2018" | ||||||
| description = "Deduplicated, compressed and encrypted content pile manager" | description = "Deduplicated, compressed and encrypted content pile manager" | ||||||
|  | |||||||
| @ -273,6 +273,8 @@ pub fn store_fully<PT: ProgressTracker>( | |||||||
|             progress_bar, |             progress_bar, | ||||||
|             num_workers, |             num_workers, | ||||||
|         )?; |         )?; | ||||||
|  |         // must drop the pipeline to allow the threads to close
 | ||||||
|  |         drop(pipeline); | ||||||
|         while let Ok(_) = control_rx.recv() { |         while let Ok(_) = control_rx.recv() { | ||||||
|             // TODO nothing for now.
 |             // TODO nothing for now.
 | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -94,14 +94,17 @@ pub fn existence_checker_stage<RP: RawPile>( | |||||||
|         let next_stage = next_stage.clone(); |         let next_stage = next_stage.clone(); | ||||||
|         let rx = rx.clone(); |         let rx = rx.clone(); | ||||||
|         let pile = pile.clone(); |         let pile = pile.clone(); | ||||||
|         std::thread::spawn(move || { |         std::thread::Builder::new() | ||||||
|  |             .name("yama exist?er".to_string()) | ||||||
|  |             .spawn(move || { | ||||||
|                 while let Ok((chunk_id, chunk)) = rx.recv() { |                 while let Ok((chunk_id, chunk)) = rx.recv() { | ||||||
|                     // TODO handle errors properly
 |                     // TODO handle errors properly
 | ||||||
|                     if !pile.chunk_exists(&chunk_id).unwrap() { |                     if !pile.chunk_exists(&chunk_id).unwrap() { | ||||||
|                         next_stage.send((chunk_id, chunk)).unwrap(); |                         next_stage.send((chunk_id, chunk)).unwrap(); | ||||||
|                     } |                     } | ||||||
|                 } |                 } | ||||||
|         }); |             }) | ||||||
|  |             .unwrap(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     tx |     tx | ||||||
|  | |||||||
| @ -269,7 +269,9 @@ impl<R: RawPile> RawPile for RawPileCompressor<R> { | |||||||
|             let receiver = receiver.clone(); |             let receiver = receiver.clone(); | ||||||
|             let controller_send = controller_send.clone(); |             let controller_send = controller_send.clone(); | ||||||
|             let this = (*self).clone(); |             let this = (*self).clone(); | ||||||
|             thread::spawn(move || { |             thread::Builder::new() | ||||||
|  |                 .name(format!("yama Pcomp{}", compressor_number)) | ||||||
|  |                 .spawn(move || { | ||||||
|                     let worker_id = Arc::new(format!("compressor-{}", compressor_number)); |                     let worker_id = Arc::new(format!("compressor-{}", compressor_number)); | ||||||
|                     if let Err(err) = this.storage_pipeline_worker( |                     if let Err(err) = this.storage_pipeline_worker( | ||||||
|                         subsequent_pipeline, |                         subsequent_pipeline, | ||||||
| @ -283,7 +285,8 @@ impl<R: RawPile> RawPile for RawPileCompressor<R> { | |||||||
|                             }) |                             }) | ||||||
|                             .expect("This is BAD: failed to send failure message to controller."); |                             .expect("This is BAD: failed to send failure message to controller."); | ||||||
|                     } |                     } | ||||||
|             }); |                 }) | ||||||
|  |                 .unwrap(); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         Ok(input_to_this_stage) |         Ok(input_to_this_stage) | ||||||
|  | |||||||
| @ -126,7 +126,9 @@ impl<RP: RawPile> RawPile for RawPileIntegrityChecker<RP> { | |||||||
|             .underlying |             .underlying | ||||||
|             .build_storage_pipeline(settings, controller_send)?; |             .build_storage_pipeline(settings, controller_send)?; | ||||||
|         let (input, receiver) = crossbeam_channel::bounded::<(ChunkId, Vec<u8>)>(64); |         let (input, receiver) = crossbeam_channel::bounded::<(ChunkId, Vec<u8>)>(64); | ||||||
|         std::thread::spawn(move || { |         std::thread::Builder::new() | ||||||
|  |             .name("yama integrity".to_string()) | ||||||
|  |             .spawn(move || { | ||||||
|                 while let Ok((chunk_id, mut chunk)) = receiver.recv() { |                 while let Ok((chunk_id, mut chunk)) = receiver.recv() { | ||||||
|                     let mut hasher = twox_hash::XxHash64::with_seed(XXH64_SEED); |                     let mut hasher = twox_hash::XxHash64::with_seed(XXH64_SEED); | ||||||
|                     hasher.write(&chunk); |                     hasher.write(&chunk); | ||||||
| @ -134,7 +136,8 @@ impl<RP: RawPile> RawPile for RawPileIntegrityChecker<RP> { | |||||||
|                     chunk.extend_from_slice(&computed_hash); |                     chunk.extend_from_slice(&computed_hash); | ||||||
|                     next_stage.send((chunk_id, chunk)).unwrap(); |                     next_stage.send((chunk_id, chunk)).unwrap(); | ||||||
|                 } |                 } | ||||||
|         }); |             }) | ||||||
|  |             .unwrap(); | ||||||
|         Ok(input) |         Ok(input) | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user