@@ -21,7 +21,10 @@ use chroma_system::{
21
21
wrap, ChannelError , ComponentContext , ComponentHandle , Dispatcher , Handler , Orchestrator ,
22
22
PanicError , TaskError , TaskMessage , TaskResult ,
23
23
} ;
24
- use chroma_types:: { chroma_proto:: CollectionVersionInfo , CollectionUuid } ;
24
+ use chroma_types:: {
25
+ chroma_proto:: { CollectionVersionFile , CollectionVersionInfo } ,
26
+ CollectionUuid ,
27
+ } ;
25
28
use chrono:: DateTime ;
26
29
use itertools:: Itertools ;
27
30
use petgraph:: { dot:: Dot , graph:: DiGraph , prelude:: DiGraphMap } ;
@@ -58,6 +61,7 @@ pub struct ConstructVersionGraphOrchestrator {
58
61
59
62
graph : DiGraphMap < InternalVersionGraphNode , ( ) > ,
60
63
graph_data : HashMap < InternalVersionGraphNode , VersionGraphNodeData > ,
64
+ version_files : HashMap < CollectionUuid , CollectionVersionFile > ,
61
65
num_pending_tasks : usize ,
62
66
}
63
67
@@ -82,13 +86,13 @@ impl ConstructVersionGraphOrchestrator {
82
86
83
87
graph : DiGraphMap :: new ( ) ,
84
88
graph_data : HashMap :: new ( ) ,
89
+ version_files : HashMap :: new ( ) ,
85
90
num_pending_tasks : 0 ,
86
91
}
87
92
}
88
93
}
89
94
90
95
#[ derive( Debug , Clone ) ]
91
- #[ allow( dead_code) ]
92
96
pub struct VersionGraphNode {
93
97
pub collection_id : CollectionUuid ,
94
98
pub version : i64 ,
@@ -98,8 +102,8 @@ pub struct VersionGraphNode {
98
102
pub type VersionGraph = DiGraph < VersionGraphNode , ( ) > ;
99
103
100
104
#[ derive( Debug ) ]
101
- #[ allow( dead_code) ]
102
105
pub struct ConstructVersionGraphResponse {
106
+ pub version_files : HashMap < CollectionUuid , CollectionVersionFile > ,
103
107
pub graph : VersionGraph ,
104
108
}
105
109
@@ -259,8 +263,14 @@ impl ConstructVersionGraphOrchestrator {
259
263
None => return ,
260
264
} ;
261
265
262
- self . terminate_with_result ( Ok ( ConstructVersionGraphResponse { graph } ) , ctx)
263
- . await ;
266
+ self . terminate_with_result (
267
+ Ok ( ConstructVersionGraphResponse {
268
+ graph,
269
+ version_files : self . version_files . clone ( ) ,
270
+ } ) ,
271
+ ctx,
272
+ )
273
+ . await ;
264
274
}
265
275
}
266
276
@@ -368,6 +378,8 @@ impl Handler<TaskResult<FetchVersionFileOutput, FetchVersionFileError>>
368
378
}
369
379
} ;
370
380
let collection_id = output. collection_id ;
381
+ self . version_files
382
+ . insert ( collection_id, output. file . clone ( ) ) ;
371
383
372
384
let versions = match output. file . version_history {
373
385
Some ( versions) => versions. versions ,
0 commit comments