chore(docs): refine part 1, 2

Signed-off-by: Alex Chi <iskyzh@gmail.com>
This commit is contained in:
Alex Chi
2022-12-24 00:26:11 -05:00
parent c7acc44169
commit b263ea4fac
5 changed files with 19 additions and 1 deletions

View File

@@ -1,5 +1,7 @@
# Overview
<!-- toc -->
In this tutorial, you will learn how to build a simple LSM-Tree storage engine in the Rust programming language.
## What is LSM, and Why LSM?

View File

@@ -1,5 +1,7 @@
# Block Builder and Block Iterator
<!-- toc -->
In this part, you will need to modify:
* `src/block/builder.rs`

View File

@@ -57,7 +57,11 @@ impl FileObject {
}
}
pub struct SsTable {}
pub struct SsTable {
file: FileObject,
block_metas: Vec<BlockMeta>,
block_meta_offset: usize,
}
impl SsTable {
/// Open SSTable from a file.

View File

@@ -9,6 +9,7 @@ use super::{BlockMeta, SsTable};
/// Builds an SSTable from key-value pairs.
pub struct SsTableBuilder {
pub(super) meta: Vec<BlockMeta>,
// Add other fields you need.
}
impl SsTableBuilder {

View File

@@ -8,6 +8,7 @@ use duct::cmd;
#[derive(clap::Subcommand, Debug)]
enum CopyTestAction {
Day1,
Day2,
}
#[derive(clap::Subcommand, Debug)]
@@ -132,6 +133,14 @@ fn copy_test_case(test: CopyTestAction) -> Result<()> {
)
.run()?;
}
CopyTestAction::Day2 => {
cmd!(
"cp",
"mini-lsm/src/table/tests.rs",
"mini-lsm-starter/src/table/tests.rs"
)
.run()?;
}
}
Ok(())
}