Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion helixdb/src/helix_engine/graph_core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ pub mod config;
pub mod graph_core;
pub mod ops;
pub mod traversal_iter;

#[cfg(test)]
mod traversal_tests;
6 changes: 3 additions & 3 deletions helixdb/src/helix_engine/graph_core/ops/g.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::helix_engine::{
storage_core::storage_core::HelixGraphStorage,
types::GraphError,
};
use heed3::{RoTxn, RwTxn};
use heed3::{RoTxn, RwTxn, WithoutTls};
use std::sync::Arc;

pub struct G {}
Expand All @@ -27,7 +27,7 @@ impl G {
#[inline]
pub fn new<'a>(
storage: Arc<HelixGraphStorage>,
txn: &'a RoTxn<'a>,
txn: &'a RoTxn<'a, WithoutTls>,
) -> RoTraversalIterator<'a, impl Iterator<Item = Result<TraversalVal, GraphError>>>
where
Self: Sized,
Expand Down Expand Up @@ -56,7 +56,7 @@ impl G {
/// ```
pub fn new_from<'a>(
storage: Arc<HelixGraphStorage>,
txn: &'a RoTxn<'a>,
txn: &'a RoTxn<'a, WithoutTls>,
items: Vec<TraversalVal>,
) -> RoTraversalIterator<'a, impl Iterator<Item = Result<TraversalVal, GraphError>>> {
RoTraversalIterator {
Expand Down
6 changes: 3 additions & 3 deletions helixdb/src/helix_engine/graph_core/ops/in_/in_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::{
},
protocol::label_hash::hash_label,
};
use heed3::{types::Bytes, RoTxn};
use heed3::{types::Bytes, RoTxn, WithoutTls};
use std::sync::Arc;

pub struct InNodesIterator<'a, T> {
Expand All @@ -27,7 +27,7 @@ pub struct InNodesIterator<'a, T> {
edge_type: &'a EdgeType,
}

impl<'a> Iterator for InNodesIterator<'a, RoTxn<'a>> {
impl<'a> Iterator for InNodesIterator<'a, RoTxn<'a, WithoutTls>> {
type Item = Result<TraversalVal, GraphError>;

fn next(&mut self) -> Option<Self::Item> {
Expand Down Expand Up @@ -78,7 +78,7 @@ pub trait InAdapter<'a, T>: Iterator<Item = Result<TraversalVal, GraphError>> {
) -> RoTraversalIterator<'a, impl Iterator<Item = Result<TraversalVal, GraphError>>>;
}

impl<'a, I: Iterator<Item = Result<TraversalVal, GraphError>> + 'a> InAdapter<'a, RoTxn<'a>>
impl<'a, I: Iterator<Item = Result<TraversalVal, GraphError>> + 'a> InAdapter<'a, RoTxn<'a, WithoutTls>>
for RoTraversalIterator<'a, I>
{
#[inline]
Expand Down
6 changes: 3 additions & 3 deletions helixdb/src/helix_engine/graph_core/ops/in_/in_e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::{
},
protocol::label_hash::hash_label,
};
use heed3::{types::Bytes, RoTxn};
use heed3::{types::Bytes, RoTxn, WithoutTls};
use std::sync::Arc;

pub struct InEdgesIterator<'a, T> {
Expand All @@ -23,7 +23,7 @@ pub struct InEdgesIterator<'a, T> {
txn: &'a T,
}

impl<'a> Iterator for InEdgesIterator<'a, RoTxn<'a>> {
impl<'a> Iterator for InEdgesIterator<'a, RoTxn<'a, WithoutTls>> {
type Item = Result<TraversalVal, GraphError>;

fn next(&mut self) -> Option<Self::Item> {
Expand Down Expand Up @@ -64,7 +64,7 @@ pub trait InEdgesAdapter<'a, T>: Iterator<Item = Result<TraversalVal, GraphError
) -> RoTraversalIterator<'a, impl Iterator<Item = Result<TraversalVal, GraphError>>>;
}

impl<'a, I: Iterator<Item = Result<TraversalVal, GraphError>>> InEdgesAdapter<'a, RoTxn<'a>>
impl<'a, I: Iterator<Item = Result<TraversalVal, GraphError>>> InEdgesAdapter<'a, RoTxn<'a, WithoutTls>>
for RoTraversalIterator<'a, I>
{
#[inline]
Expand Down
6 changes: 3 additions & 3 deletions helixdb/src/helix_engine/graph_core/ops/in_/to_n.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::helix_engine::{
storage_core::{storage_core::HelixGraphStorage, storage_methods::StorageMethods},
types::GraphError,
};
use heed3::RoTxn;
use heed3::{RoTxn, WithoutTls};
use std::sync::Arc;

pub struct ToNIterator<'a, I, T> {
Expand All @@ -13,7 +13,7 @@ pub struct ToNIterator<'a, I, T> {
}

// implementing iterator for OutIterator
impl<'a, I> Iterator for ToNIterator<'a, I, RoTxn<'a>>
impl<'a, I> Iterator for ToNIterator<'a, I, RoTxn<'a, WithoutTls>>
where
I: Iterator<Item = Result<TraversalVal, GraphError>>,
{
Expand Down Expand Up @@ -43,7 +43,7 @@ pub trait ToNAdapter<'a, T>: Iterator<Item = Result<TraversalVal, GraphError>> {
) -> RoTraversalIterator<'a, impl Iterator<Item = Result<TraversalVal, GraphError>>>;
}

impl<'a, I: Iterator<Item = Result<TraversalVal, GraphError>>> ToNAdapter<'a, RoTxn<'a>>
impl<'a, I: Iterator<Item = Result<TraversalVal, GraphError>>> ToNAdapter<'a, RoTxn<'a, WithoutTls>>
for RoTraversalIterator<'a, I>
{
#[inline(always)]
Expand Down
6 changes: 3 additions & 3 deletions helixdb/src/helix_engine/graph_core/ops/out/from_n.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::helix_engine::{
storage_core::{storage_core::HelixGraphStorage, storage_methods::StorageMethods},
types::GraphError,
};
use heed3::RoTxn;
use heed3::{RoTxn, WithoutTls};
use std::sync::Arc;

pub struct FromNIterator<'a, I, T> {
Expand All @@ -12,7 +12,7 @@ pub struct FromNIterator<'a, I, T> {
txn: &'a T,
}

impl<'a, I> Iterator for FromNIterator<'a, I, RoTxn<'a>>
impl<'a, I> Iterator for FromNIterator<'a, I, RoTxn<'a, WithoutTls>>
where
I: Iterator<Item = Result<TraversalVal, GraphError>>,
{
Expand Down Expand Up @@ -44,7 +44,7 @@ pub trait FromNAdapter<'a, T>: Iterator<Item = Result<TraversalVal, GraphError>>
) -> RoTraversalIterator<'a, impl Iterator<Item = Result<TraversalVal, GraphError>>>;
}

impl<'a, I: Iterator<Item = Result<TraversalVal, GraphError>> + 'a> FromNAdapter<'a, RoTxn<'a>>
impl<'a, I: Iterator<Item = Result<TraversalVal, GraphError>> + 'a> FromNAdapter<'a, RoTxn<'a, WithoutTls>>
for RoTraversalIterator<'a, I>
{
#[inline(always)]
Expand Down
6 changes: 3 additions & 3 deletions helixdb/src/helix_engine/graph_core/ops/out/out.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::{
},
protocol::label_hash::hash_label,
};
use heed3::{types::Bytes, RoTxn};
use heed3::{types::Bytes, RoTxn, WithoutTls};
use std::sync::Arc;

pub struct OutNodesIterator<'a, T> {
Expand All @@ -27,7 +27,7 @@ pub struct OutNodesIterator<'a, T> {
txn: &'a T,
}

impl<'a> Iterator for OutNodesIterator<'a, RoTxn<'a>> {
impl<'a> Iterator for OutNodesIterator<'a, RoTxn<'a, WithoutTls>> {
type Item = Result<TraversalVal, GraphError>;

fn next(&mut self) -> Option<Self::Item> {
Expand Down Expand Up @@ -78,7 +78,7 @@ pub trait OutAdapter<'a, T>: Iterator<Item = Result<TraversalVal, GraphError>> {
) -> RoTraversalIterator<'a, impl Iterator<Item = Result<TraversalVal, GraphError>>>;
}

impl<'a, I: Iterator<Item = Result<TraversalVal, GraphError>>> OutAdapter<'a, RoTxn<'a>>
impl<'a, I: Iterator<Item = Result<TraversalVal, GraphError>>> OutAdapter<'a, RoTxn<'a, WithoutTls>>
for RoTraversalIterator<'a, I>
{
#[inline]
Expand Down
6 changes: 3 additions & 3 deletions helixdb/src/helix_engine/graph_core/ops/out/out_e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::{
},
protocol::label_hash::hash_label,
};
use heed3::{types::Bytes, RoTxn};
use heed3::{types::Bytes, RoTxn, WithoutTls};
use std::sync::Arc;

pub struct OutEdgesIterator<'a, T> {
Expand All @@ -23,7 +23,7 @@ pub struct OutEdgesIterator<'a, T> {
txn: &'a T,
}

impl<'a> Iterator for OutEdgesIterator<'a, RoTxn<'a>> {
impl<'a> Iterator for OutEdgesIterator<'a, RoTxn<'a, WithoutTls>> {
type Item = Result<TraversalVal, GraphError>;

fn next(&mut self) -> Option<Self::Item> {
Expand Down Expand Up @@ -64,7 +64,7 @@ pub trait OutEdgesAdapter<'a, T>: Iterator<Item = Result<TraversalVal, GraphErro
) -> RoTraversalIterator<'a, impl Iterator<Item = Result<TraversalVal, GraphError>>>;
}

impl<'a, I: Iterator<Item = Result<TraversalVal, GraphError>> + 'a> OutEdgesAdapter<'a, RoTxn<'a>>
impl<'a, I: Iterator<Item = Result<TraversalVal, GraphError>> + 'a> OutEdgesAdapter<'a, RoTxn<'a, WithoutTls>>
for RoTraversalIterator<'a, I>
{
#[inline]
Expand Down
6 changes: 3 additions & 3 deletions helixdb/src/helix_engine/graph_core/ops/source/e_from_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{
},
protocol::items::Edge,
};
use heed3::RoTxn;
use heed3::{RoTxn, WithoutTls};
use std::{iter::Once, sync::Arc};

pub struct EFromId<'a, T> {
Expand All @@ -16,7 +16,7 @@ pub struct EFromId<'a, T> {
id: &'a u128,
}

impl<'a> Iterator for EFromId<'a, RoTxn<'a>> {
impl<'a> Iterator for EFromId<'a, RoTxn<'a, WithoutTls>> {

type Item = Result<TraversalVal, GraphError>;

Expand All @@ -42,7 +42,7 @@ pub trait EFromIdAdapter<'a>: Iterator<Item = Result<TraversalVal, GraphError>>
impl<'a, I: Iterator<Item = Result<TraversalVal, GraphError>>> EFromIdAdapter<'a>
for RoTraversalIterator<'a, I>
{
type OutputIter = RoTraversalIterator<'a, EFromId<'a, RoTxn<'a>>>;
type OutputIter = RoTraversalIterator<'a, EFromId<'a, RoTxn<'a, WithoutTls>>>;

#[inline]
fn e_from_id(self, id: &'a u128) -> Self::OutputIter {
Expand Down
6 changes: 3 additions & 3 deletions helixdb/src/helix_engine/graph_core/ops/source/n_from_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{
},
protocol::items::Node,
};
use heed3::RoTxn;
use heed3::{RoTxn, WithoutTls};
use std::{iter::Once, sync::Arc};

pub struct NFromId<'a, T> {
Expand All @@ -16,7 +16,7 @@ pub struct NFromId<'a, T> {
id: u128,
}

impl<'a> Iterator for NFromId<'a, RoTxn<'a>> {
impl<'a> Iterator for NFromId<'a, RoTxn<'a, WithoutTls>> {
type Item = Result<TraversalVal, GraphError>;

fn next(&mut self) -> Option<Self::Item> {
Expand All @@ -42,7 +42,7 @@ pub trait NFromIdAdapter<'a>: Iterator<Item = Result<TraversalVal, GraphError>>
impl<'a, I: Iterator<Item = Result<TraversalVal, GraphError>>> NFromIdAdapter<'a>
for RoTraversalIterator<'a, I>
{
type OutputIter = RoTraversalIterator<'a, NFromId<'a, RoTxn<'a>>>;
type OutputIter = RoTraversalIterator<'a, NFromId<'a, RoTxn<'a, WithoutTls>>>;

#[inline]
fn n_from_id(self, id: &u128) -> Self::OutputIter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{
},
protocol::value::Value,
};
use heed3::RoTxn;
use heed3::{RoTxn, WithoutTls};
use serde::Serialize;
use std::{iter::Once, sync::Arc};

Expand All @@ -18,7 +18,7 @@ pub struct NFromIndex<'a, T, K: Into<Value> + Serialize> {
key: &'a K,
}

impl<'a, K> Iterator for NFromIndex<'a, RoTxn<'a>, K>
impl<'a, K> Iterator for NFromIndex<'a, RoTxn<'a, WithoutTls>, K>
where
K: Into<Value> + Serialize,
{
Expand Down Expand Up @@ -69,7 +69,7 @@ pub trait NFromIndexAdapter<'a, K: Into<Value> + Serialize>:
impl<'a, I: Iterator<Item = Result<TraversalVal, GraphError>>, K: Into<Value> + Serialize + 'a>
NFromIndexAdapter<'a, K> for RoTraversalIterator<'a, I>
{
type OutputIter = RoTraversalIterator<'a, NFromIndex<'a, RoTxn<'a>, K>>;
type OutputIter = RoTraversalIterator<'a, NFromIndex<'a, RoTxn<'a, WithoutTls>, K>>;

#[inline]
fn n_from_index(self, index: &'a str, key: &'a K) -> Self::OutputIter
Expand Down
4 changes: 2 additions & 2 deletions helixdb/src/helix_engine/graph_core/ops/util/filter_ref.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use crate::helix_engine::{graph_core::traversal_iter::RoTraversalIterator, types::GraphError};

use super::super::tr_val::TraversalVal;
use heed3::RoTxn;
use heed3::{RoTxn, WithoutTls};

pub struct FilterRef<'a, I, F> {
iter: I,
txn: &'a RoTxn<'a>,
txn: &'a RoTxn<'a, WithoutTls>,
f: F,
}

Expand Down
10 changes: 5 additions & 5 deletions helixdb/src/helix_engine/graph_core/ops/util/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ use crate::helix_engine::{
};

use super::super::tr_val::TraversalVal;
use heed3::RoTxn;
use heed3::{RoTxn, WithoutTls} ;

pub struct Map<'a, I, F> {
iter: I,
txn: &'a RoTxn<'a>,
txn: &'a RoTxn<'a, WithoutTls>,
f: F,
}

// implementing iterator for filter ref
impl<'a, I, F> Iterator for Map<'a, I, F>
where
I: Iterator<Item = Result<TraversalVal, GraphError>>,
F: FnMut(TraversalVal, &RoTxn<'a>) -> Result<TraversalVal, GraphError>,
F: FnMut(TraversalVal, &RoTxn<'a, WithoutTls>) -> Result<TraversalVal, GraphError>,
{
type Item = I::Item;

Expand Down Expand Up @@ -51,7 +51,7 @@ pub trait MapAdapter<'a>: Iterator<Item = Result<TraversalVal, GraphError>> {
f: F,
) -> RoTraversalIterator<'a, impl Iterator<Item = Result<TraversalVal, GraphError>>>
where
F: FnMut(TraversalVal, &RoTxn<'a>) -> Result<TraversalVal, GraphError>;
F: FnMut(TraversalVal, &RoTxn<'a, WithoutTls>) -> Result<TraversalVal, GraphError>;
}

impl<'a, I: Iterator<Item = Result<TraversalVal, GraphError>>> MapAdapter<'a>
Expand All @@ -63,7 +63,7 @@ impl<'a, I: Iterator<Item = Result<TraversalVal, GraphError>>> MapAdapter<'a>
f: F,
) -> RoTraversalIterator<'a, impl Iterator<Item = Result<TraversalVal, GraphError>>>
where
F: FnMut(TraversalVal, &RoTxn<'a>) -> Result<TraversalVal, GraphError>,
F: FnMut(TraversalVal, &RoTxn<'a, WithoutTls>) -> Result<TraversalVal, GraphError>,
{
RoTraversalIterator {
inner: Map {
Expand Down
Loading