Skip to content

Commit 27c060b

Browse files
committed
Minor tweaks
1 parent f4c5dfa commit 27c060b

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

downstairs/src/dynamometer.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ pub async fn dynamometer(
8383
.collect();
8484

8585
let io_operation_time = Instant::now();
86-
region.region_write(&writes, JobId(1000), false).await?;
86+
let pre = PrecomputedWrite::from_writes(&writes);
87+
region
88+
.region_write_pre(&writes, &pre, JobId(1000), false)
89+
.await?;
8790

8891
total_io_time += io_operation_time.elapsed();
8992
io_operations_sent += num_writes;

downstairs/src/lib.rs

+10-3
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,10 @@ pub async fn downstairs_import<P: AsRef<Path> + std::fmt::Debug>(
327327
}
328328

329329
// We have no job ID, so it makes no sense for accounting.
330-
region.region_write(&writes, JobId(0), false).await?;
330+
let pre = PrecomputedWrite::from_writes(&writes);
331+
region
332+
.region_write_pre(&writes, &pre, JobId(0), false)
333+
.await?;
331334

332335
assert_eq!(nblocks, pos);
333336
assert_eq!(total, pos.bytes());
@@ -1164,9 +1167,13 @@ where
11641167
* │ │ │ │
11651168
* ┌────▼──┴─┐ message ┌┴──────┐ job ┌┴────────┐
11661169
* │resp_loop├──────────►│pf_task├─────────►│ dw_task │
1167-
* └─────────┘ channel └──┬────┘ channel └▲────────┘
1170+
* └──┬───▲──┘ channel └──┬────┘ channel └▲────────┘
1171+
* │ │ │ │
1172+
* defer│ │oneshot │ │
1173+
* ┌▼───┴┐ │ │
1174+
* │rayon│ add│work new│work
1175+
* └─────┘ │ │
11681176
* │ │
1169-
* add│work new│work
11701177
* per-connection │ │
11711178
* ========================= │ ============== │ ===============
11721179
* shared state ┌──▼────────────────┴────────────┐

downstairs/src/region.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,10 @@ impl Region {
764764
Ok(result)
765765
}
766766

767+
/// Perform a region write, without precomputed data
768+
///
769+
/// This is only allowed in unit tests
770+
#[cfg(test)]
767771
#[instrument]
768772
pub async fn region_write(
769773
&mut self,
@@ -821,7 +825,7 @@ impl Region {
821825
let extent = self.get_opened_extent_mut(*eid);
822826
let (writes, ctxs) = batched_writes.get(eid).unwrap();
823827
extent
824-
.write(job_id, &writes, &ctxs, only_write_unwritten)
828+
.write(job_id, writes, ctxs, only_write_unwritten)
825829
.await?;
826830
}
827831

0 commit comments

Comments
 (0)