keep only the essentials

main
Ziyang Hu 2 years ago
parent 5a8156058a
commit e5b510fa8d

@ -8,26 +8,26 @@ use miette::{bail, ensure, Diagnostic, Result};
use smartstring::{LazyCompact, SmartString}; use smartstring::{LazyCompact, SmartString};
use thiserror::Error; use thiserror::Error;
use crate::algo::all_pairs_shortest_path::{BetweennessCentrality, ClosenessCentrality}; // use crate::algo::all_pairs_shortest_path::{BetweennessCentrality, ClosenessCentrality};
use crate::algo::astar::ShortestPathAStar; // use crate::algo::astar::ShortestPathAStar;
use crate::algo::bfs::Bfs; // use crate::algo::bfs::Bfs;
use crate::algo::constant::Constant; use crate::algo::constant::Constant;
use crate::algo::csv::CsvReader; // use crate::algo::csv::CsvReader;
use crate::algo::degree_centrality::DegreeCentrality; // use crate::algo::degree_centrality::DegreeCentrality;
use crate::algo::dfs::Dfs; // use crate::algo::dfs::Dfs;
use crate::algo::jlines::JsonReader; // use crate::algo::jlines::JsonReader;
use crate::algo::kruskal::MinimumSpanningForestKruskal; // use crate::algo::kruskal::MinimumSpanningForestKruskal;
use crate::algo::label_propagation::LabelPropagation; // use crate::algo::label_propagation::LabelPropagation;
use crate::algo::louvain::CommunityDetectionLouvain; // use crate::algo::louvain::CommunityDetectionLouvain;
use crate::algo::pagerank::PageRank; // use crate::algo::pagerank::PageRank;
use crate::algo::prim::MinimumSpanningTreePrim; // use crate::algo::prim::MinimumSpanningTreePrim;
use crate::algo::random_walk::RandomWalk; // use crate::algo::random_walk::RandomWalk;
use crate::algo::reorder_sort::ReorderSort; // use crate::algo::reorder_sort::ReorderSort;
use crate::algo::shortest_path_dijkstra::ShortestPathDijkstra; // use crate::algo::shortest_path_dijkstra::ShortestPathDijkstra;
use crate::algo::strongly_connected_components::StronglyConnectedComponent; use crate::algo::strongly_connected_components::StronglyConnectedComponent;
use crate::algo::top_sort::TopSort; // use crate::algo::top_sort::TopSort;
use crate::algo::triangles::ClusteringCoefficients; // use crate::algo::triangles::ClusteringCoefficients;
use crate::algo::yen::KShortestPathYen; // use crate::algo::yen::KShortestPathYen;
use crate::data::expr::Expr; use crate::data::expr::Expr;
use crate::data::program::{MagicAlgoApply, MagicAlgoRuleArg, MagicSymbol}; use crate::data::program::{MagicAlgoApply, MagicAlgoRuleArg, MagicSymbol};
use crate::data::symb::Symbol; use crate::data::symb::Symbol;
@ -38,26 +38,26 @@ use crate::runtime::db::Poison;
use crate::runtime::in_mem::InMemRelation; use crate::runtime::in_mem::InMemRelation;
use crate::runtime::transact::SessionTx; use crate::runtime::transact::SessionTx;
pub(crate) mod all_pairs_shortest_path; // pub(crate) mod all_pairs_shortest_path;
pub(crate) mod astar; // pub(crate) mod astar;
pub(crate) mod bfs; // pub(crate) mod bfs;
pub(crate) mod constant; pub(crate) mod constant;
pub(crate) mod csv; // pub(crate) mod csv;
pub(crate) mod degree_centrality; // pub(crate) mod degree_centrality;
pub(crate) mod dfs; // pub(crate) mod dfs;
pub(crate) mod jlines; // pub(crate) mod jlines;
pub(crate) mod kruskal; // pub(crate) mod kruskal;
pub(crate) mod label_propagation; // pub(crate) mod label_propagation;
pub(crate) mod louvain; // pub(crate) mod louvain;
pub(crate) mod pagerank; // pub(crate) mod pagerank;
pub(crate) mod prim; // pub(crate) mod prim;
pub(crate) mod random_walk; // pub(crate) mod random_walk;
pub(crate) mod reorder_sort; // pub(crate) mod reorder_sort;
pub(crate) mod shortest_path_dijkstra; // pub(crate) mod shortest_path_dijkstra;
pub(crate) mod strongly_connected_components; pub(crate) mod strongly_connected_components;
pub(crate) mod top_sort; // pub(crate) mod top_sort;
pub(crate) mod triangles; // pub(crate) mod triangles;
pub(crate) mod yen; // pub(crate) mod yen;
pub(crate) trait AlgoImpl { pub(crate) trait AlgoImpl {
fn run<'a>( fn run<'a>(
@ -106,29 +106,29 @@ impl AlgoHandle {
pub(crate) fn get_impl(&self) -> Result<Box<dyn AlgoImpl>> { pub(crate) fn get_impl(&self) -> Result<Box<dyn AlgoImpl>> {
Ok(match &self.name.name as &str { Ok(match &self.name.name as &str {
"ClusteringCoefficients" => Box::new(ClusteringCoefficients), // "ClusteringCoefficients" => Box::new(ClusteringCoefficients),
"DegreeCentrality" => Box::new(DegreeCentrality), // "DegreeCentrality" => Box::new(DegreeCentrality),
"ClosenessCentrality" => Box::new(ClosenessCentrality), // "ClosenessCentrality" => Box::new(ClosenessCentrality),
"BetweennessCentrality" => Box::new(BetweennessCentrality), // "BetweennessCentrality" => Box::new(BetweennessCentrality),
"DepthFirstSearch" | "DFS" => Box::new(Dfs), // "DepthFirstSearch" | "DFS" => Box::new(Dfs),
"BreadthFirstSearch" | "BFS" => Box::new(Bfs), // "BreadthFirstSearch" | "BFS" => Box::new(Bfs),
"ShortestPathDijkstra" => Box::new(ShortestPathDijkstra), // "ShortestPathDijkstra" => Box::new(ShortestPathDijkstra),
"ShortestPathAStar" => Box::new(ShortestPathAStar), // "ShortestPathAStar" => Box::new(ShortestPathAStar),
"KShortestPathYen" => Box::new(KShortestPathYen), // "KShortestPathYen" => Box::new(KShortestPathYen),
"MinimumSpanningTreePrim" => Box::new(MinimumSpanningTreePrim), // "MinimumSpanningTreePrim" => Box::new(MinimumSpanningTreePrim),
"MinimumSpanningForestKruskal" => Box::new(MinimumSpanningForestKruskal), // "MinimumSpanningForestKruskal" => Box::new(MinimumSpanningForestKruskal),
"TopSort" => Box::new(TopSort), // "TopSort" => Box::new(TopSort),
"ConnectedComponents" => Box::new(StronglyConnectedComponent::new(false)), // "ConnectedComponents" => Box::new(StronglyConnectedComponent::new(false)),
"StronglyConnectedComponents" | "SCC" => { "StronglyConnectedComponents" | "SCC" => {
Box::new(StronglyConnectedComponent::new(true)) Box::new(StronglyConnectedComponent::new(true))
} }
"PageRank" => Box::new(PageRank), // "PageRank" => Box::new(PageRank),
"CommunityDetectionLouvain" => Box::new(CommunityDetectionLouvain), // "CommunityDetectionLouvain" => Box::new(CommunityDetectionLouvain),
"LabelPropagation" => Box::new(LabelPropagation), // "LabelPropagation" => Box::new(LabelPropagation),
"RandomWalk" => Box::new(RandomWalk), // "RandomWalk" => Box::new(RandomWalk),
"ReorderSort" => Box::new(ReorderSort), // "ReorderSort" => Box::new(ReorderSort),
"JsonReader" => Box::new(JsonReader), // "JsonReader" => Box::new(JsonReader),
"CsvReader" => Box::new(CsvReader), // "CsvReader" => Box::new(CsvReader),
"Constant" => Box::new(Constant), "Constant" => Box::new(Constant),
name => bail!(AlgoNotFoundError(name.to_string(), self.name.span)), name => bail!(AlgoNotFoundError(name.to_string(), self.name.span)),
}) })

@ -20,8 +20,8 @@ pub use miette::Error;
pub use runtime::db::Db; pub use runtime::db::Db;
pub use storage::rocks::{new_cozo_rocksdb, RocksDbStorage}; pub use storage::rocks::{new_cozo_rocksdb, RocksDbStorage};
pub use storage::sled::{new_cozo_sled, SledStorage}; // pub use storage::sled::{new_cozo_sled, SledStorage};
pub use storage::tikv::{new_cozo_tikv, TiKvStorage}; // pub use storage::tikv::{new_cozo_tikv, TiKvStorage};
// pub use storage::re::{new_cozo_redb, ReStorage}; // pub use storage::re::{new_cozo_redb, ReStorage};

@ -7,8 +7,8 @@ use miette::Result;
use crate::data::tuple::Tuple; use crate::data::tuple::Tuple;
pub(crate) mod rocks; pub(crate) mod rocks;
pub(crate) mod sled; // pub(crate) mod sled;
pub(crate) mod tikv; // pub(crate) mod tikv;
// pub(crate) mod re; // pub(crate) mod re;
pub trait Storage { pub trait Storage {

Loading…
Cancel
Save