[refactor-block] refactor DataBlock and DataBlockPath

This commit is contained in:
Alex Auvolat
2024-02-23 12:11:14 +01:00
parent 07c7895948
commit cd1069c1d4
3 changed files with 88 additions and 78 deletions
+2 -2
View File
@@ -584,8 +584,8 @@ impl Worker for RebalanceWorker {
let prim_loc = self.manager.data_layout.load().primary_block_dir(&hash);
if path.ancestors().all(|x| x != prim_loc) {
let block_path = match path.extension() {
None => DataBlockPath::Plain(path.clone()),
Some(x) if x.to_str() == Some("zst") => DataBlockPath::Compressed(path.clone()),
None => DataBlockPath::plain(path.clone()),
Some(x) if x.to_str() == Some("zst") => DataBlockPath::compressed(path.clone()),
_ => {
warn!("not rebalancing file: {}", path.to_string_lossy());
return Ok(WorkerState::Busy);