diff --git a/kvrouter/src/main.rs b/kvrouter/src/main.rs index b5081545..2cb1c915 100644 --- a/kvrouter/src/main.rs +++ b/kvrouter/src/main.rs @@ -9,16 +9,13 @@ async fn main() { // List of backend servers let backends = vec![ "http://localhost:8000".to_string(), - // "http://localhost:8001".to_string(), + "http://localhost:8001".to_string(), // "http://localhost:8002".to_string(), // "http://localhost:8003".to_string(), ]; // Create a new instance of the RoundRobinRouter - println!("Using Content aware"); - // Create the Axum router - let (sx, rx) = tokio::sync::mpsc::channel(100); let communicator = Communicator::new(sx); tokio::task::spawn(async move { @@ -28,6 +25,9 @@ async fn main() { let mut router = OverloadHandler::new(lb, backends, rx); router.run().await; } else { + println!("Using Content aware"); + // Create the Axum router + let lb = ContentAware::new(); let mut router = OverloadHandler::new(lb, backends, rx); router.run().await; diff --git a/kvrouter/src/trie.rs b/kvrouter/src/trie.rs index 8062af60..691df357 100644 --- a/kvrouter/src/trie.rs +++ b/kvrouter/src/trie.rs @@ -124,6 +124,7 @@ impl Node { } #[cfg(debug_assertions)] + #[allow(dead_code)] fn remove(&mut self, data: &[u8]) -> Result<(), Error> { // TODO reclaim the nodes too. let mismatch = mismatch(data, &self.content); @@ -155,7 +156,7 @@ impl Trie { self.root.insert(data) } - // TODO + #[cfg(debug_assertions)] #[allow(dead_code)] pub fn remove(&mut self, data: &[u8]) -> Result<(), Error> { self.root.remove(data)