From 621d7a8cf3826043250a76fb5982e3c18d9e5a46 Mon Sep 17 00:00:00 2001 From: 0x29a Date: Mon, 25 Mar 2024 03:23:07 +0800 Subject: [PATCH] chore: typos & refine comments (#65) * typo in week2-01-compaction.md * chroe: typos & add comments * chore: more typos * Update week2-01-compaction.md --------- Co-authored-by: Alex Chi Z --- mini-lsm-book/src/week2-01-compaction.md | 2 +- mini-lsm-book/src/week2-04-leveled.md | 2 +- mini-lsm-mvcc/src/block/iterator.rs | 2 +- mini-lsm-starter/src/block/iterator.rs | 2 +- mini-lsm/src/block/iterator.rs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mini-lsm-book/src/week2-01-compaction.md b/mini-lsm-book/src/week2-01-compaction.md index cb4b35c..c3c0ef4 100644 --- a/mini-lsm-book/src/week2-01-compaction.md +++ b/mini-lsm-book/src/week2-01-compaction.md @@ -66,7 +66,7 @@ Because we always compact all SSTs, if we find multiple version of a key, we can There are some things that you might need to think about. -* How does your implementation handle L0 flush in par with compaction? (Not taking the state lock when doing the compaction, and also need to consider new L0 files produced when compaction is going on.) +* How does your implementation handle L0 flush in parallel with compaction? (Not taking the state lock when doing the compaction, and also need to consider new L0 files produced when compaction is going on.) * If your implementation removes the original SST files immediately after the compaction completes, will it cause problems in your system? (Generally no on macOS/Linux because the OS will not actually remove the file until no file handle is being held.) ## Task 2: Concat Iterator diff --git a/mini-lsm-book/src/week2-04-leveled.md b/mini-lsm-book/src/week2-04-leveled.md index 3710415..760e91f 100644 --- a/mini-lsm-book/src/week2-04-leveled.md +++ b/mini-lsm-book/src/week2-04-leveled.md @@ -63,7 +63,7 @@ In addition, at most *one* level can have a positive target size below `base_lev 0 0 30MB 300MB 3GB 30GB ``` -Notice in this case L1 and L2 have target size of 0, and L3 is the only level with a postive target size below `base_level_size_mb`. +Notice in this case L1 and L2 have target size of 0, and L3 is the only level with a positive target size below `base_level_size_mb`. ### Task 1.2: Decide Base Level diff --git a/mini-lsm-mvcc/src/block/iterator.rs b/mini-lsm-mvcc/src/block/iterator.rs index 5ce0b3a..20006d9 100644 --- a/mini-lsm-mvcc/src/block/iterator.rs +++ b/mini-lsm-mvcc/src/block/iterator.rs @@ -15,7 +15,7 @@ pub struct BlockIterator { block: Arc, /// the current key at the iterator position key: KeyVec, - /// the value range from the block + /// the current value range in the block.data, corresponds to the current key value_range: (usize, usize), /// the current index at the iterator position idx: usize, diff --git a/mini-lsm-starter/src/block/iterator.rs b/mini-lsm-starter/src/block/iterator.rs index f823b5a..d2d867e 100644 --- a/mini-lsm-starter/src/block/iterator.rs +++ b/mini-lsm-starter/src/block/iterator.rs @@ -13,7 +13,7 @@ pub struct BlockIterator { block: Arc, /// The current key, empty represents the iterator is invalid key: KeyVec, - /// the value range from the block + /// the current value range in the block.data, corresponds to the current key value_range: (usize, usize), /// Current index of the key-value pair, should be in range of [0, num_of_elements) idx: usize, diff --git a/mini-lsm/src/block/iterator.rs b/mini-lsm/src/block/iterator.rs index 65b06af..0df3b9a 100644 --- a/mini-lsm/src/block/iterator.rs +++ b/mini-lsm/src/block/iterator.rs @@ -15,7 +15,7 @@ pub struct BlockIterator { block: Arc, /// the current key at the iterator position key: KeyVec, - /// the value range from the block + /// the current value range in the block.data, corresponds to the current key value_range: (usize, usize), /// the current index at the iterator position idx: usize,