Skip to content

Commit eb821be

Browse files
authored
chore: Remove unused RouterType and ModelMetaData (ai-dynamo#1138)
Remove RouterType and ModelMetaData in `lib/runtime/src/protocols.rs`, which are unused (no outside reference). It is because that the routing has been moved to its own module, `pipeline/network/egress/push_router.rs`. Therefore, the legacy definition of RouterType in `protocols.rs` is no longer used.
1 parent 80256ac commit eb821be

File tree

1 file changed

+0
-47
lines changed

1 file changed

+0
-47
lines changed

lib/runtime/src/protocols.rs

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -183,59 +183,12 @@ impl Endpoint {
183183
}
184184
}
185185

186-
#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq)]
187-
#[serde(rename_all = "snake_case")]
188-
pub enum RouterType {
189-
PushRoundRobin,
190-
PushRandom,
191-
}
192-
193-
impl Default for RouterType {
194-
fn default() -> Self {
195-
Self::PushRandom
196-
}
197-
}
198-
199-
#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq)]
200-
pub struct ModelMetaData {
201-
pub name: String,
202-
pub component: Component,
203-
pub router_type: RouterType,
204-
}
205-
206186
#[cfg(test)]
207187
mod tests {
208188
use super::*;
209189
use std::convert::TryFrom;
210190
use std::str::FromStr;
211191

212-
#[test]
213-
fn test_router_type_default() {
214-
let default_router = RouterType::default();
215-
assert_eq!(default_router, RouterType::PushRandom);
216-
}
217-
218-
#[test]
219-
fn test_router_type_serialization() {
220-
let router_round_robin = RouterType::PushRoundRobin;
221-
let router_random = RouterType::PushRandom;
222-
223-
let serialized_round_robin = serde_json::to_string(&router_round_robin).unwrap();
224-
let serialized_random = serde_json::to_string(&router_random).unwrap();
225-
226-
assert_eq!(serialized_round_robin, "\"push_round_robin\"");
227-
assert_eq!(serialized_random, "\"push_random\"");
228-
}
229-
230-
#[test]
231-
fn test_router_type_deserialization() {
232-
let round_robin: RouterType = serde_json::from_str("\"push_round_robin\"").unwrap();
233-
let random: RouterType = serde_json::from_str("\"push_random\"").unwrap();
234-
235-
assert_eq!(round_robin, RouterType::PushRoundRobin);
236-
assert_eq!(random, RouterType::PushRandom);
237-
}
238-
239192
#[test]
240193
fn test_valid_endpoint_from() {
241194
let input = "namespace1/component1/endpoint1";

0 commit comments

Comments
 (0)