chore(docs): refine part 1, 2
Signed-off-by: Alex Chi <iskyzh@gmail.com>
This commit is contained in:
@@ -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?
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# Block Builder and Block Iterator
|
||||
|
||||
<!-- toc -->
|
||||
|
||||
In this part, you will need to modify:
|
||||
|
||||
* `src/block/builder.rs`
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user