Skip to content

Commit 5161841

Browse files
committed
Rename GraphPropSegment etc -> GraphSegment
1 parent 40227fe commit 5161841

File tree

7 files changed

+29
-29
lines changed

7 files changed

+29
-29
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use raphtory_core::entities::properties::tprop::IllegalPropType;
88
use raphtory_core::storage::timeindex::TimeIndexEntry;
99
use raphtory_api::core::entities::properties::prop::Prop;
1010

11-
pub trait GraphPropSegmentOps: Send + Sync + Debug + 'static
11+
pub trait GraphSegmentOps: Send + Sync + Debug + 'static
1212
where
1313
Self: Sized,
1414
{

db4-storage/src/api/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
pub mod edges;
22
pub mod nodes;
3-
pub mod graph_props;
3+
pub mod graph;

db4-storage/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use crate::{
2626
};
2727
use parking_lot::RwLock;
2828
use raphtory_api::core::entities::{EID, VID};
29-
use segments::{edge::MemEdgeSegment, graph_prop::GraphPropSegmentView, node::MemNodeSegment};
29+
use segments::{edge::MemEdgeSegment, graph::GraphSegmentView, node::MemNodeSegment};
3030

3131
pub mod api;
3232
pub mod gen_t_props;
@@ -42,7 +42,7 @@ pub mod wal;
4242
pub type Extension = NoOpStrategy;
4343
pub type NS<P> = NodeSegmentView<P>;
4444
pub type ES<P> = EdgeSegmentView<P>;
45-
pub type GPS = GraphPropSegmentView;
45+
pub type GS = GraphSegmentView;
4646
pub type Layer<P> = GraphStore<NS<P>, ES<P>, P>;
4747

4848
pub type WalImpl = NoWal;
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
use std::path::{Path, PathBuf};
22
use std::sync::Arc;
3-
use crate::api::graph_props::GraphPropSegmentOps;
3+
use crate::api::graph::GraphSegmentOps;
44
use crate::error::StorageError;
55
use crate::persist::strategy::Config;
66
use raphtory_core::entities::properties::graph_meta::GraphMeta;
77

88
/// Backing store for graph temporal properties and graph metadata.
99
/// GPS: GraphPropSegment?
1010
#[derive(Debug)]
11-
pub struct GraphPropStorageInner<GPS, EXT> {
12-
page: Arc<GPS>,
11+
pub struct GraphStorageInner<GS, EXT> {
12+
page: Arc<GS>,
1313

1414
/// Stores graph prop metadata (prop name -> prop id mappings, etc).
1515
graph_meta: Arc<GraphMeta>,
@@ -19,7 +19,7 @@ pub struct GraphPropStorageInner<GPS, EXT> {
1919
ext: EXT,
2020
}
2121

22-
impl<GPS: GraphPropSegmentOps, EXT: Config> GraphPropStorageInner<GPS, EXT> {
22+
impl<GPS: GraphSegmentOps, EXT: Config> GraphStorageInner<GPS, EXT> {
2323
pub fn new(path: Option<PathBuf>, ext: EXT) -> Self {
2424
let page = Arc::new(GPS::new());
2525
let graph_meta = Arc::new(GraphMeta::new());

db4-storage/src/pages/mod.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ use crate::{
66
persist::strategy::{Config, PersistentStrategy},
77
properties::props_meta_writer::PropsMetaWriter,
88
segments::{edge::MemEdgeSegment, node::MemNodeSegment},
9-
GPS,
9+
GS,
1010
};
1111
use edge_page::writer::EdgeWriter;
1212
use edge_store::EdgeStorageInner;
1313
use node_page::writer::{NodeWriter, WriterPair};
1414
use node_store::NodeStorageInner;
15-
use graph_prop_store::GraphPropStorageInner;
15+
use graph_store::GraphStorageInner;
1616
use parking_lot::RwLockWriteGuard;
1717
use raphtory_api::core::{
1818
entities::properties::{meta::Meta, prop::Prop},
@@ -40,7 +40,7 @@ pub mod locked;
4040
pub mod node_page;
4141
pub mod node_store;
4242
pub mod session;
43-
pub mod graph_prop_store;
43+
pub mod graph_store;
4444
#[cfg(any(test, feature = "test-utils"))]
4545
pub mod test_utils;
4646

@@ -50,7 +50,7 @@ pub mod test_utils;
5050
pub struct GraphStore<NS, ES, EXT: Config> {
5151
nodes: Arc<NodeStorageInner<NS, EXT>>,
5252
edges: Arc<EdgeStorageInner<ES, EXT>>,
53-
graph_props: Arc<GraphPropStorageInner<GPS, EXT>>,
53+
graph: Arc<GraphStorageInner<GS, EXT>>,
5454
graph_dir: Option<PathBuf>,
5555
event_id: AtomicUsize,
5656
_ext: EXT,
@@ -96,8 +96,8 @@ impl<
9696
&self.edges
9797
}
9898

99-
pub fn graph_props(&self) -> &Arc<GraphPropStorageInner<GPS, EXT>> {
100-
&self.graph_props
99+
pub fn graph(&self) -> &Arc<GraphStorageInner<GS, EXT>> {
100+
&self.graph
101101
}
102102

103103
pub fn edge_meta(&self) -> &Meta {
@@ -109,7 +109,7 @@ impl<
109109
}
110110

111111
pub fn graph_meta(&self) -> &GraphMeta {
112-
self.graph_props.graph_meta()
112+
self.graph.graph_meta()
113113
}
114114

115115
pub fn earliest(&self) -> i64 {
@@ -142,14 +142,14 @@ impl<
142142
}
143143

144144
// Load graph temporal properties and metadata
145-
let meta = Arc::new(GraphPropStorageInner::load(meta_path, ext.clone())?);
145+
let meta = Arc::new(GraphStorageInner::load(meta_path, ext.clone())?);
146146

147147
let t_len = edges.t_len();
148148

149149
Ok(Self {
150150
nodes,
151151
edges,
152-
graph_props: meta,
152+
graph: meta,
153153
event_id: AtomicUsize::new(t_len),
154154
graph_dir: Some(graph_dir.as_ref().to_path_buf()),
155155
_ext: ext,
@@ -182,7 +182,7 @@ impl<
182182
edge_meta,
183183
ext.clone(),
184184
));
185-
let graph_prop_storage = Arc::new(GraphPropStorageInner::new_with_meta(
185+
let graph_prop_storage = Arc::new(GraphStorageInner::new_with_meta(
186186
graph_props_path,
187187
graph_meta,
188188
ext.clone(),
@@ -195,7 +195,7 @@ impl<
195195
Self {
196196
nodes: node_storage,
197197
edges: edge_storage,
198-
graph_props: graph_prop_storage,
198+
graph: graph_prop_storage,
199199
event_id: AtomicUsize::new(0),
200200
graph_dir: graph_dir.map(|p| p.to_path_buf()),
201201
_ext: ext,
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use raphtory_core::entities::properties::graph_meta::GraphMeta;
22
use std::path::Path;
33
use std::sync::Arc;
44
use std::sync::atomic::AtomicUsize;
5-
use crate::api::graph_props::{GraphPropSegmentOps, GraphPropOps};
5+
use crate::api::graph::{GraphSegmentOps, GraphPropOps};
66
use crate::error::StorageError;
77
use parking_lot::RwLock;
88
use raphtory_core::entities::properties::props::MetadataError;
@@ -14,34 +14,34 @@ use crate::properties::Properties;
1414

1515
/// In-memory segment that contains graph temporal properties and graph metadata.
1616
#[derive(Debug)]
17-
pub struct MemGraphPropSegment {
17+
pub struct MemGraphSegment {
1818
properties: Properties,
1919
}
2020

21-
impl MemGraphPropSegment {
21+
impl MemGraphSegment {
2222
pub fn new() -> Self {
2323
Self {
2424
properties: Properties::default(),
2525
}
2626
}
2727
}
2828

29-
/// `GraphPropSegmentView` manages graph temporal properties and graph metadata
29+
/// `GraphSegmentView` manages graph temporal properties and graph metadata
3030
/// (constant properties). Reads / writes are always served from the in-memory segment.
3131
#[derive(Debug)]
32-
pub struct GraphPropSegmentView {
32+
pub struct GraphSegmentView {
3333
/// In-memory segment that contains the latest graph properties
3434
/// and graph metadata writes.
35-
head: Arc<RwLock<MemGraphPropSegment>>,
35+
head: Arc<RwLock<MemGraphSegment>>,
3636

3737
/// Estimated size of the segment in bytes.
3838
est_size: AtomicUsize,
3939
}
4040

41-
impl GraphPropSegmentOps for GraphPropSegmentView {
41+
impl GraphSegmentOps for GraphSegmentView {
4242
fn new() -> Self {
4343
Self {
44-
head: Arc::new(RwLock::new(MemGraphPropSegment::new())),
44+
head: Arc::new(RwLock::new(MemGraphSegment::new())),
4545
est_size: AtomicUsize::new(0),
4646
}
4747
}
@@ -51,7 +51,7 @@ impl GraphPropSegmentOps for GraphPropSegmentView {
5151
}
5252
}
5353

54-
impl GraphPropOps for GraphPropSegmentView {
54+
impl GraphPropOps for GraphSegmentView {
5555
fn get_temporal_prop(&self, prop_id: usize) -> Option<LockedView<'_, TProp>> {
5656
todo!()
5757
}

db4-storage/src/segments/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use std::{
2020

2121
pub mod edge;
2222
pub mod node;
23-
pub mod graph_prop;
23+
pub mod graph;
2424

2525
pub mod additions;
2626
pub mod edge_entry;

0 commit comments

Comments
 (0)