sync starter code

Signed-off-by: Alex Chi <iskyzh@gmail.com>
This commit is contained in:
Alex Chi
2024-01-20 11:11:09 +08:00
parent cfa7c0c2af
commit 9fd30f6aa8
15 changed files with 615 additions and 55 deletions

View File

@@ -0,0 +1,30 @@
use std::fs::File;
use std::path::Path;
use std::sync::Arc;
use anyhow::Result;
use bytes::Bytes;
use crossbeam_skiplist::SkipMap;
use parking_lot::Mutex;
pub struct Wal {
file: Arc<Mutex<File>>,
}
impl Wal {
pub fn create(path: impl AsRef<Path>) -> Result<Self> {
unimplemented!()
}
pub fn recover(path: impl AsRef<Path>, skiplist: &SkipMap<Bytes, Bytes>) -> Result<Self> {
unimplemented!()
}
pub fn put(&self, key: &[u8], value: &[u8]) -> Result<()> {
unimplemented!()
}
pub fn sync(&self) -> Result<()> {
unimplemented!()
}
}