Skip to content

Commit

Permalink
move DiskGraph struct up one level
Browse files Browse the repository at this point in the history
  • Loading branch information
ljeub-pometry committed Jul 4, 2024
1 parent a5c0f60 commit ecea53a
Show file tree
Hide file tree
Showing 27 changed files with 384 additions and 381 deletions.
2 changes: 1 addition & 1 deletion pometry-storage-private
2 changes: 1 addition & 1 deletion raphtory-cypher/examples/raphtory_cypher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ mod cypher {
use arrow::util::pretty::print_batches;
use clap::Parser;
use futures::{stream, StreamExt};
use raphtory::disk_graph::graph_impl::{DiskGraph, ParquetLayerCols};
use raphtory::disk_graph::{graph_impl::ParquetLayerCols, DiskGraph};
use raphtory_cypher::{run_cypher, run_cypher_to_streams, run_sql};
use serde::{de::DeserializeOwned, Deserialize};

Expand Down
2 changes: 1 addition & 1 deletion raphtory-cypher/src/executor/table_provider/edge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use datafusion::{
};
use futures::Stream;
use pometry_storage::prelude::*;
use raphtory::disk_graph::graph_impl::DiskGraph;
use raphtory::disk_graph::DiskGraph;

use crate::executor::{arrow2_to_arrow_buf, ExecError};

Expand Down
2 changes: 1 addition & 1 deletion raphtory-cypher/src/executor/table_provider/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use futures::Stream;
use pometry_storage::properties::ConstProps;
use raphtory::{
core::entities::VID,
disk_graph::{graph_impl::DiskGraph, prelude::*},
disk_graph::{prelude::*, DiskGraph},
};
use std::{any::Any, fmt::Formatter, sync::Arc};

Expand Down
5 changes: 2 additions & 3 deletions raphtory-cypher/src/hop/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,16 @@ use datafusion::{
use datafusion::physical_expr::Partitioning;
use futures::{Stream, StreamExt};

use crate::take_record_batch;
use pometry_storage::graph_fragment::TempColGraphFragment;
use raphtory::{
core::{entities::VID, Direction},
disk_graph::{
graph_impl::DiskGraph,
prelude::{ArrayOps, BaseArrayOps, PrimitiveCol},
DiskGraph,
},
};

use crate::take_record_batch;

use super::operator::HopPlan;

#[derive(Debug)]
Expand Down
2 changes: 1 addition & 1 deletion raphtory-cypher/src/hop/operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use datafusion::{
logical_expr::{Expr, LogicalPlan, TableScan, UserDefinedLogicalNodeCore},
};

use raphtory::{core::Direction, disk_graph::graph_impl::DiskGraph};
use raphtory::{core::Direction, disk_graph::DiskGraph};

#[derive(Debug, PartialEq, Hash, Eq)]
pub struct HopPlan {
Expand Down
7 changes: 3 additions & 4 deletions raphtory-cypher/src/hop/rule.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::sync::Arc;

use crate::hop::operator::HopPlan;
use async_trait::async_trait;
use datafusion::{
common::Column,
Expand All @@ -10,9 +11,7 @@ use datafusion::{
physical_plan::ExecutionPlan,
physical_planner::{DefaultPhysicalPlanner, ExtensionPlanner, PhysicalPlanner},
};
use raphtory::{core::Direction, disk_graph::graph_impl::DiskGraph};

use crate::hop::operator::HopPlan;
use raphtory::{core::Direction, disk_graph::DiskGraph};

use super::execution::HopExec;

Expand Down Expand Up @@ -141,7 +140,7 @@ impl ExtensionPlanner for HopPlanner {
#[cfg(test)]
mod test {
use arrow::util::pretty::print_batches;
use raphtory::disk_graph::graph_impl::DiskGraph;
use raphtory::disk_graph::DiskGraph;
use tempfile::tempdir;

use crate::prepare_plan;
Expand Down
8 changes: 3 additions & 5 deletions raphtory-cypher/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ mod cypher {
parser::ast::*,
*,
};
use raphtory::disk_graph::graph_impl::DiskGraph;
use raphtory::disk_graph::DiskGraph;

use crate::{
executor::table_provider::node::NodeTableProvider,
Expand Down Expand Up @@ -185,9 +185,8 @@ mod cypher {
use arrow_array::RecordBatch;
use tempfile::tempdir;

use raphtory::{disk_graph::graph_impl::DiskGraph, prelude::*};

use crate::run_cypher;
use raphtory::{disk_graph::DiskGraph, prelude::*};

lazy_static::lazy_static! {
static ref EDGES: Vec<(u64, u64, i64, f64)> = vec![
Expand Down Expand Up @@ -278,10 +277,9 @@ mod cypher {
datatypes::*,
};
use arrow::util::pretty::print_batches;
use raphtory::disk_graph::{graph_impl::ParquetLayerCols, DiskGraph};
use tempfile::tempdir;

use raphtory::disk_graph::graph_impl::{DiskGraph, ParquetLayerCols};

use crate::run_cypher;

fn schema() -> ArrowSchema {
Expand Down
9 changes: 3 additions & 6 deletions raphtory-cypher/src/transpiler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use raphtory::{
Direction,
},
db::{api::properties::internal::ConstPropertiesOps, graph::node::NodeView},
disk_graph::graph_impl::DiskGraph,
disk_graph::DiskGraph,
prelude::*,
};
use sqlparser::ast::{
Expand Down Expand Up @@ -1143,18 +1143,15 @@ fn sql_like(

#[cfg(test)]
mod test {

use crate::{parser, transpiler};

use super::*;
use pretty_assertions::assert_eq;
use raphtory::{
db::{api::mutation::AdditionOps, graph::graph::Graph},
disk_graph::DiskGraph,
prelude::NO_PROPS,
};
use tempfile::tempdir;

use pretty_assertions::assert_eq;

#[test]
fn count_all_nodes() {
check_cypher_to_sql(
Expand Down
2 changes: 1 addition & 1 deletion raphtory-graphql/src/data.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use parking_lot::RwLock;
#[cfg(feature = "storage")]
use raphtory::disk_graph::graph_impl::DiskGraph;
use raphtory::disk_graph::DiskGraph;
use raphtory::{
core::Prop,
db::api::view::MaterializedGraph,
Expand Down
2 changes: 1 addition & 1 deletion raphtory-graphql/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ mod graphql_test {
use async_graphql::UploadValue;
use dynamic_graphql::{Request, Variables};
#[cfg(feature = "storage")]
use raphtory::disk_graph::graph_impl::DiskGraph;
use raphtory::disk_graph::DiskGraph;
use raphtory::{
db::{api::view::IntoDynamic, graph::views::deletion_graph::PersistentGraph},
prelude::*,
Expand Down
2 changes: 1 addition & 1 deletion raphtory/src/db/api/view/internal/materialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use serde::{de::Error, Deserialize, Deserializer, Serialize};
use std::path::Path;

#[cfg(feature = "storage")]
use crate::disk_graph::graph_impl::DiskGraph;
use crate::disk_graph::DiskGraph;

#[enum_dispatch(CoreGraphOps)]
#[enum_dispatch(InternalLayerOps)]
Expand Down
2 changes: 1 addition & 1 deletion raphtory/src/disk_graph/graph_impl/const_properties_ops.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{db::api::properties::internal::ConstPropertiesOps, prelude::Prop};
use raphtory_api::core::storage::arc_str::ArcStr;

use super::DiskGraph;
use crate::disk_graph::DiskGraph;

impl ConstPropertiesOps for DiskGraph {
#[doc = " Find id for property name (note this only checks the meta-data, not if the property actually exists for the entity)"]
Expand Down
2 changes: 1 addition & 1 deletion raphtory/src/disk_graph/graph_impl/core_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ use crate::{
view::{internal::CoreGraphOps, BoxedIter},
},
disk_graph::{
graph_impl::DiskGraph,
storage_interface::{
edge::DiskOwnedEdge,
edges::DiskEdges,
node::{DiskNode, DiskOwnedNode},
nodes::DiskNodesOwned,
},
DiskGraph,
},
};
use itertools::Itertools;
Expand Down
2 changes: 1 addition & 1 deletion raphtory/src/disk_graph/graph_impl/edge_filter_ops.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::DiskGraph;
use crate::{
core::entities::LayerIds,
db::api::{storage::edges::edge_ref::EdgeStorageRef, view::internal::EdgeFilterOps},
disk_graph::DiskGraph,
};

impl EdgeFilterOps for DiskGraph {
Expand Down
2 changes: 1 addition & 1 deletion raphtory/src/disk_graph/graph_impl/layer_ops.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::DiskGraph;
use crate::{
core::{entities::LayerIds, utils::errors::GraphError},
db::api::view::internal::InternalLayerOps,
disk_graph::DiskGraph,
prelude::Layer,
};
use itertools::Itertools;
Expand Down
2 changes: 1 addition & 1 deletion raphtory/src/disk_graph/graph_impl/list_ops.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
db::api::view::internal::{CoreGraphOps, EdgeList, ListOps, NodeList},
disk_graph::graph_impl::DiskGraph,
disk_graph::DiskGraph,
};
use rayon::prelude::*;

Expand Down
2 changes: 1 addition & 1 deletion raphtory/src/disk_graph/graph_impl/materialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::{
db::api::view::{internal::InternalMaterialize, MaterializedGraph},
};

use super::DiskGraph;
use crate::disk_graph::DiskGraph;

impl InternalMaterialize for DiskGraph {
fn new_base_graph(&self, _graph: InternalGraph) -> MaterializedGraph {
Expand Down
Loading

0 comments on commit ecea53a

Please sign in to comment.