31 lines
603 B
Rust
31 lines
603 B
Rust
|
|
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!()
|
||
|
|
}
|
||
|
|
}
|