Skip to content

Commit 5980bd0

Browse files
committed
feat: add distributed expand/search traversal and e2e graph tests
Extract a shared distributed traversal substrate and reuse it across compute, expansion, and search. Add GraphEngine-grounded end-to-end traversal tests including expand/search plus compute PageRank and weighted SSSP with non-transactional edge setup.
1 parent abf95e1 commit 5980bd0

24 files changed

Lines changed: 961 additions & 20 deletions

File tree

src/server/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use crate::graph::GraphEngine;
1616
use crate::job::logger::JobLogger;
1717
use crate::server::schema::SchemaContainer;
1818
use crate::traversal::compute::ComputeService;
19+
use crate::traversal::expand::distributed::ExpandService;
1920

2021
pub mod general;
2122
pub mod schema;
@@ -292,6 +293,13 @@ impl MorpheusServer {
292293
Ok(service_ref)
293294
}
294295

296+
pub async fn init_expand_service(&self) -> Result<Arc<ExpandService>, String> {
297+
let service = ExpandService::new(self.graph.clone(), self.neb_server.consh.clone());
298+
let service_ref = service.clone();
299+
self.neb_server.rpc.register_service(&service_ref).await;
300+
Ok(service_ref)
301+
}
302+
295303
/// Initialize the embedding index service with default configuration
296304
///
297305
/// This sets up the embedding indexer and registers it with Neb.

src/tests/compute/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ use crate::traversal::compute::{
1010
};
1111
use crate::traversal::compute::apps::{PageRankConfig, PageRankProgram};
1212
use crate::traversal::compute::apps::SsspProgram;
13-
use crate::traversal::compute::vertex_set::VertexSetManifest;
14-
use crate::traversal::compute::vertex_set::VertexSetShard;
13+
use crate::traversal::dist::VertexSetManifest;
14+
use crate::traversal::dist::VertexSetShard;
1515

1616
struct TestCodec;
1717

src/tests/dist/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
use crate::traversal::dist::partition_by;
2+
use dovahkiin::types::Id;
3+
4+
#[test]
5+
fn test_partition_by_groups_ids() {
6+
let ids = vec![Id::new(0, 1), Id::new(0, 2), Id::new(1, 1)];
7+
let parts = partition_by(ids, |id| Some(id.higher));
8+
assert_eq!(parts.len(), 2);
9+
assert_eq!(parts.get(&0).unwrap().len(), 2);
10+
assert_eq!(parts.get(&1).unwrap().len(), 1);
11+
}

0 commit comments

Comments
 (0)