diff --git a/conf/node_1.json b/conf/node_1.json index c9fe3b9..1137647 100644 --- a/conf/node_1.json +++ b/conf/node_1.json @@ -1,12 +1,10 @@ { "port": 3001, - "storage_engine": "in_memory", "quorum": { "n": 3, "r": 2, "w": 2 }, - "partitioning_scheme": "consistent_hashing", "heartbeat": { "fanout": 2, "interval": 500 diff --git a/conf/node_2.json b/conf/node_2.json index 628d526..382fb9a 100644 --- a/conf/node_2.json +++ b/conf/node_2.json @@ -1,12 +1,10 @@ { "port": 3002, - "storage_engine": "in_memory", "quorum": { "n": 3, "r": 2, "w": 2 }, - "partitioning_scheme": "consistent_hashing", "heartbeat": { "fanout": 2, "interval": 500 diff --git a/conf/node_3.json b/conf/node_3.json index 2033ae4..7962132 100644 --- a/conf/node_3.json +++ b/conf/node_3.json @@ -1,12 +1,10 @@ { "port": 3003, - "storage_engine": "in_memory", "quorum": { "n": 3, "r": 2, "w": 2 }, - "partitioning_scheme": "consistent_hashing", "heartbeat": { "fanout": 2, "interval": 500 diff --git a/src/server/config.rs b/src/server/config.rs index 857b4ff..15b457a 100644 --- a/src/server/config.rs +++ b/src/server/config.rs @@ -7,7 +7,6 @@ use serde::{Deserialize, Serialize}; #[serde(rename_all = "snake_case")] pub struct Config { pub port: u16, - pub partitioning_scheme: PartitioningScheme, pub quorum: Quorum, pub heartbeat: Heartbeat, } @@ -40,17 +39,11 @@ pub struct Heartbeat { pub interval: usize, } -#[derive(Serialize, Deserialize)] -#[serde(rename_all = "snake_case")] -pub enum PartitioningScheme { - ConsistentHashing, -} - #[cfg(test)] mod tests { use std::path::PathBuf; - use crate::server::config::{Heartbeat, PartitioningScheme, Quorum}; + use crate::server::config::{Heartbeat, Quorum}; use super::Config; @@ -67,7 +60,6 @@ mod tests { config, Config { port: 3001, - partitioning_scheme: PartitioningScheme::ConsistentHashing, quorum: Quorum { replicas: 3, reads: 2, diff --git a/src/server/mod.rs b/src/server/mod.rs index e22bee4..b8f7eb9 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -61,13 +61,11 @@ impl Server { // configure the partitioning_scheme. This step already // includes the node itself to the ring. - let cluster_state = match config.partitioning_scheme { - config::PartitioningScheme::ConsistentHashing => Arc::new(State::new( - Box::::default(), - client_listener.local_addr().unwrap().to_string().into(), - config.quorum, - )?), - }; + let cluster_state = Arc::new(State::new( + Box::::default(), + client_listener.local_addr().unwrap().to_string().into(), + config.quorum, + )?); // FIXME: There's a big problem here - if this task exists how will // the node know that it has to shutdown? Something to be fixed soon... diff --git a/tests/conf/test_node_config.json b/tests/conf/test_node_config.json index 7d85c8e..7e9129e 100644 --- a/tests/conf/test_node_config.json +++ b/tests/conf/test_node_config.json @@ -5,7 +5,6 @@ "r": 2, "w": 2 }, - "partitioning_scheme": "consistent_hashing", "heartbeat": { "fanout": 10, "interval": 200