This commit is contained in:
Arthur Petukhovsky
2023-03-03 20:33:55 +00:00
parent 9cada8b59d
commit 17cd96e022
5 changed files with 32 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ pub mod control_file_upgrade;
pub mod debug_dump;
pub mod handler;
pub mod http;
pub mod sim;
pub mod json_ctrl;
pub mod metrics;
pub mod receive_wal;

View File

@@ -0,0 +1,7 @@
pub trait Storage {
fn flush_pos(&self) -> u32;
fn flush(&mut self) -> Result<()>;
fn write(&mut self, )
}

View File

@@ -0,0 +1,21 @@
use std::collections::HashMap;
pub struct DiskLog {
pub
}
impl KV {
pub fn new() -> Self {
Self {
map: HashMap::new(),
}
}
pub fn get(&self, key: &str) -> u32 {
self.map.get(key).copied().unwrap_or(0)
}
pub fn set(&mut self, key: &str, value: u32) {
self.map.insert(key.to_string(), value);
}
}

View File

@@ -0,0 +1,3 @@
pub mod disklog;
pub mod proto;
pub mod disk;

View File