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

View File

@@ -1,5 +1,7 @@
# Block Builder and Block Iterator # Block Builder and Block Iterator
<!-- toc -->
In this part, you will need to modify: In this part, you will need to modify:
* `src/block/builder.rs` * `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 { impl SsTable {
/// Open SSTable from a file. /// Open SSTable from a file.

View File

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

View File

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