mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-16 18:02:56 +00:00
WIP
This commit is contained in:
@@ -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;
|
||||
|
||||
7
safekeeper/src/sim/disk.rs
Normal file
7
safekeeper/src/sim/disk.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
|
||||
pub trait Storage {
|
||||
fn flush_pos(&self) -> u32;
|
||||
fn flush(&mut self) -> Result<()>;
|
||||
fn write(&mut self, )
|
||||
}
|
||||
21
safekeeper/src/sim/disklog.rs
Normal file
21
safekeeper/src/sim/disklog.rs
Normal 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);
|
||||
}
|
||||
}
|
||||
3
safekeeper/src/sim/mod.rs
Normal file
3
safekeeper/src/sim/mod.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
pub mod disklog;
|
||||
pub mod proto;
|
||||
pub mod disk;
|
||||
0
safekeeper/src/sim/proto.rs
Normal file
0
safekeeper/src/sim/proto.rs
Normal file
Reference in New Issue
Block a user