MCPcopy Create free account
hub / github.com/Pometry/Raphtory / insert_graph

Method insert_graph

raphtory-graphql/src/data.rs:353–374  ·  view source on GitHub ↗
(
        &self,
        writeable_folder: ValidWriteableGraphFolder,
        graph: MaterializedGraph,
    )

Source from the content-addressed store, hash-verified

351 }
352
353 pub async fn insert_graph(
354 &self,
355 writeable_folder: ValidWriteableGraphFolder,
356 graph: MaterializedGraph,
357 ) -> Result<(), InsertionError> {
358 let key = writeable_folder.local_path().to_owned();
359 let config = self.graph_conf.clone();
360 self.cache
361 .insert_or_replace_with(&key, |old_graph| async {
362 invalidate_graph(old_graph).await;
363 blocking_compute(move || {
364 let (is_dirty, new_graph) = writeable_folder.write_graph_data(graph, config)?;
365 let folder = writeable_folder.finish()?;
366 let graph = GraphWithVectors::new(new_graph, None, folder.as_existing()?);
367 graph.set_dirty(is_dirty);
368 Ok::<_, InsertionError>(graph)
369 })
370 .await
371 })
372 .await?;
373 Ok(())
374 }
375
376 /// Insert a graph serialized from a graph folder.
377 pub async fn insert_graph_as_bytes<R: Read + Seek + Send + 'static>(

Callers 8

setup_with_graphsFunction · 0.80
setup_with_policyFunction · 0.80
save_graphs_to_work_dirFunction · 0.80
new_graphMethod · 0.80
copy_graphMethod · 0.80
send_graphMethod · 0.80
create_subgraphMethod · 0.80
create_mutable_graphFunction · 0.80

Calls 10

invalidate_graphFunction · 0.85
blocking_computeFunction · 0.85
to_ownedMethod · 0.80
write_graph_dataMethod · 0.80
as_existingMethod · 0.80
local_pathMethod · 0.45
cloneMethod · 0.45
finishMethod · 0.45
set_dirtyMethod · 0.45

Tested by 2

setup_with_graphsFunction · 0.64
setup_with_policyFunction · 0.64