mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-22 15:41:15 +00:00
Extract simlib
This commit is contained in:
@@ -19,7 +19,9 @@ pub mod receive_wal;
|
||||
pub mod remove_wal;
|
||||
pub mod safekeeper;
|
||||
pub mod send_wal;
|
||||
pub mod sim;
|
||||
pub mod simlib;
|
||||
#[cfg(test)]
|
||||
pub mod simtest;
|
||||
pub mod timeline;
|
||||
pub mod wal_backup;
|
||||
pub mod wal_service;
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
pub mod chan;
|
||||
pub mod client;
|
||||
pub mod disk;
|
||||
pub mod disklog;
|
||||
pub mod node_os;
|
||||
pub mod proto;
|
||||
#[cfg(test)]
|
||||
pub mod start_test;
|
||||
pub mod sync;
|
||||
pub mod tcp;
|
||||
pub mod time;
|
||||
@@ -1,8 +1,4 @@
|
||||
use super::{
|
||||
node_os::NodeOs,
|
||||
proto::{AnyMessage, ReplCell},
|
||||
world::NodeId,
|
||||
};
|
||||
use crate::simlib::{node_os::NodeOs, proto::{ReplCell, AnyMessage}, world::NodeId};
|
||||
|
||||
/// Copy all data from array to the remote node.
|
||||
pub fn run_client(os: NodeOs, data: &[ReplCell], dst: NodeId) {
|
||||
@@ -2,7 +2,7 @@ use std::sync::Arc;
|
||||
|
||||
use anyhow::Result;
|
||||
|
||||
use super::sync::{Mutex, Park};
|
||||
use crate::simlib::sync::{Mutex, Park};
|
||||
|
||||
pub trait Storage<T> {
|
||||
fn flush_pos(&self) -> u32;
|
||||
@@ -1,8 +1,10 @@
|
||||
mod client;
|
||||
mod disk;
|
||||
mod server;
|
||||
|
||||
use std::{sync::Arc};
|
||||
|
||||
use super::{
|
||||
client::run_client, disk::SharedStorage, disklog::run_server, proto::ReplCell, world::World,
|
||||
};
|
||||
use crate::{simlib::{world::World, proto::ReplCell}, simtest::{client::run_client, disk::SharedStorage, server::run_server}};
|
||||
|
||||
#[test]
|
||||
fn start_simulation() {
|
||||
@@ -1,6 +1,8 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use super::{disk::Storage, node_os::NodeOs, proto::AnyMessage, world::NodeEvent};
|
||||
use crate::simlib::{node_os::NodeOs, world::NodeEvent, proto::AnyMessage};
|
||||
|
||||
use super::disk::Storage;
|
||||
|
||||
pub struct DiskLog {
|
||||
pub map: HashMap<String, u32>,
|
||||
Reference in New Issue
Block a user