23 #include "jubatus/util/lang/shared_ptr.h"
25 #include "../graph/graph_factory.hpp"
26 #include "../common/vector_util.hpp"
27 #include "../storage/storage_factory.hpp"
36 using jubatus::util::lang::shared_ptr;
42 graph::graph(shared_ptr<jubatus::core::graph::graph_wo_index> graph_method)
43 : graph_(graph_method),
44 mixable_(graph_method) {
56 graph_->update_node(
id, p);
61 graph_->remove_global_node(
id);
74 graph_->update_edge(eid, p);
85 return graph_->centrality(nid, ct, q);
93 std::vector<jubatus::core::graph::node_id_t> ret;
94 graph_->shortest_path(src, target, max_hop, ret, q);
99 graph_->add_centrality_query(q);
103 graph_->add_shortest_path_query(q);
107 graph_->remove_centrality_query(q);
111 graph_->remove_shortest_path_query(q);
116 graph_->get_node(nid, info);
122 graph_->get_edge(eid, info);
137 graph_->create_global_node(nid);
140 }
catch (
const std::runtime_error& e) {
147 graph_->remove_global_node(nid);
150 }
catch (
const std::runtime_error& e) {
161 graph_->create_edge(eid, src, target);
162 graph_->update_edge(eid, p);
graph(jubatus::util::lang::shared_ptr< core::graph::graph_wo_index > graph_method)
void remove_global_node(jubatus::core::graph::node_id_t nid)
jubatus::util::lang::shared_ptr< core::graph::graph_wo_index > graph_
void update_edge(jubatus::core::graph::edge_id_t eid, const jubatus::core::graph::property &p)
jubatus::core::graph::edge_info get_edge(jubatus::core::graph::edge_id_t eid) const
void create_edge(jubatus::core::graph::edge_id_t eid, jubatus::core::graph::node_id_t src, jubatus::core::graph::node_id_t target, const jubatus::core::graph::property &p)
void remove_node(jubatus::core::graph::node_id_t id)
void remove_edge(jubatus::core::graph::edge_id_t eid)
void update_node(jubatus::core::graph::node_id_t id, const jubatus::core::graph::property &p)
void create_node(jubatus::core::graph::node_id_t id)
std::map< std::string, std::string > property
void create_node_here(jubatus::core::graph::node_id_t id)
jubatus::core::graph::node_info get_node(jubatus::core::graph::node_id_t nid) const
void pack(framework::packer &pk) const
std::vector< jubatus::core::graph::node_id_t > get_shortest_path(jubatus::core::graph::node_id_t src, jubatus::core::graph::node_id_t target, uint64_t max_hop, const jubatus::core::graph::preset_query &q) const
jubatus::core::graph::mixable_graph_wo_index mixable_
void unpack(msgpack::object o)
void add_shortest_path_query(const jubatus::core::graph::preset_query &q)
void create_edge_here(jubatus::core::graph::edge_id_t eid, jubatus::core::graph::node_id_t src, jubatus::core::graph::node_id_t target, const jubatus::core::graph::property &p)
void add_centrality_query(const jubatus::core::graph::preset_query &q)
double get_centrality(jubatus::core::graph::node_id_t nid, jubatus::core::graph::centrality_type ct, const jubatus::core::graph::preset_query &q) const
void remove_centrality_query(const jubatus::core::graph::preset_query &q)
void register_mixable(framework::mixable *mixable)
void remove_shortest_path_query(const jubatus::core::graph::preset_query &q)