Go to the documentation of this file.
16 #ifndef GRAPHSCOPE_DATABASE_GRAPH_DB_H_
17 #define GRAPHSCOPE_DATABASE_GRAPH_DB_H_
41 struct SessionLocalContext;
46 const std::string& compiler_path_ =
"",
int thread_num_ = 1)
93 int32_t thread_num = 1,
bool warmup =
false,
94 bool memory_only =
true,
95 bool enable_auto_compaction =
false);
145 uint8_t label,
const std::string& col_name)
const {
150 uint8_t label)
const {
173 bool registerApp(
const std::string& path, uint8_t index = 0);
179 const std::unordered_map<std::string, std::pair<std::string, uint8_t>>&
183 const std::string& data_dir,
214 #endif // GRAPHSCOPE_DATABASE_GRAPH_DB_H_
const GraphDBConfig & config() const
Definition: graph_db.h:170
MemoryStrategy
Definition: mmap_array.h:58
std::shared_ptr< ColumnBase > get_vertex_property_column(uint8_t label, const std::string &col_name) const
Definition: graph_db.h:144
Table & get_vertex_table(label_t vertex_label)
Definition: mutable_property_fragment.h:67
SessionLocalContext * contexts_
Definition: graph_db.h:194
const MutablePropertyFragment & graph() const
Definition: graph_db.h:139
uint32_t timestamp_t
Definition: types.h:30
std::string work_dir() const
Definition: graph_db.h:166
bool monitor_thread_running_
Definition: graph_db.h:205
int thread_num
Definition: graph_db.h:60
const Schema & schema() const
Definition: mutable_property_fragment.cc:391
static GraphDB & get()
Definition: graph_db.cc:73
GraphDBSession & GetSession(int thread_id)
Definition: graph_db.cc:299
void showAppMetrics() const
Definition: graph_db.cc:497
Definition: insert_transaction.h:34
std::shared_ptr< RefColumnBase > get_vertex_id_column(uint8_t label) const
Definition: mutable_property_fragment.h:139
int thread_num_
Definition: graph_db.h:196
std::string wal_uri
Definition: graph_db.h:72
AppWrapper CreateApp(uint8_t app_type, int thread_id)
Definition: graph_db.cc:316
Definition: adj_list.h:23
std::thread monitor_thread_
Definition: graph_db.h:204
UpdateTransaction GetUpdateTransaction(int thread_id=0)
Create a transaction to update vertices and edges.
Definition: graph_db.cc:295
int SessionNum() const
Definition: graph_db.cc:307
VersionManager version_manager_
Definition: graph_db.h:199
Definition: graph_db.cc:35
bool registerApp(const std::string &path, uint8_t index=0)
Definition: graph_db.cc:326
Result< bool > Open(const Schema &schema, const std::string &data_dir, int32_t thread_num=1, bool warmup=false, bool memory_only=true, bool enable_auto_compaction=false)
Load the graph from data directory.
Definition: graph_db.cc:78
Definition: app_utils.h:25
bool enable_monitoring
Definition: graph_db.h:62
Definition: single_edge_insert_transaction.h:30
void GetAppInfo(Encoder &result)
Definition: graph_db.cc:342
Definition: mutable_property_fragment.h:37
MutablePropertyFragment graph_
Definition: graph_db.h:198
SingleVertexInsertTransaction GetSingleVertexInsertTransaction(int thread_id=0)
Create a transaction to insert a single vertex.
Definition: graph_db.cc:285
bool warmup
Definition: graph_db.h:61
GraphDBConfig config_
Definition: graph_db.h:192
void ingestWals(IWalParser &parser, const std::string &work_dir, int thread_num)
Definition: graph_db.cc:381
std::array< std::shared_ptr< AppFactoryBase >, 256 > app_factories_
Definition: graph_db.h:202
bool enable_auto_compaction
Definition: graph_db.h:63
Definition: graph_db_session.h:36
Definition: graph_db.h:77
GraphDBConfig(const Schema &schema_, const std::string &data_dir_, const std::string &compiler_path_="", int thread_num_=1)
Definition: graph_db.h:45
std::string compiler_path
Definition: graph_db.h:59
Definition: version_manager.h:34
size_t getExecutedQueryNum() const
Definition: graph_db.cc:516
std::thread compact_thread_
Definition: graph_db.h:209
int memory_level
Definition: graph_db.h:71
Definition: read_transaction.h:375
Definition: single_vertex_insert_transaction.h:30
Schema schema
Definition: graph_db.h:57
std::string data_dir
Definition: graph_db.h:58
void initApps(const std::unordered_map< std::string, std::pair< std::string, uint8_t >> &plugins)
Definition: graph_db.cc:405
const Schema & schema() const
Definition: graph_db.h:142
ReadTransaction GetReadTransaction(int thread_id=0)
Create a transaction to read vertices and edges.
Definition: graph_db.cc:277
SingleEdgeInsertTransaction GetSingleEdgeInsertTransaction(int thread_id=0)
Create a transaction to insert a single edge.
Definition: graph_db.cc:290
void Close()
Close the current opened graph.
Definition: graph_db.cc:254
bool compact_thread_running_
Definition: graph_db.h:208
std::array< std::string, 256 > app_paths_
Definition: graph_db.h:201
~GraphDB()
Definition: graph_db.cc:56
Definition: app_base.h:78
std::shared_ptr< RefColumnBase > get_vertex_id_column(uint8_t label) const
Definition: graph_db.h:149
Definition: update_transaction.h:39
MutablePropertyFragment & graph()
Definition: graph_db.h:140
InsertTransaction GetInsertTransaction(int thread_id=0)
Create a transaction to insert vertices and edges with a default allocator.
Definition: graph_db.cc:281
timestamp_t GetLastCompactionTimestamp() const
Definition: graph_db.cc:312
Definition: graph_db.h:43
std::string work_dir_
Definition: graph_db.h:193
timestamp_t last_compaction_ts_
Definition: graph_db.h:207
void openWalAndCreateContexts(const GraphDBConfig &config, const std::string &data_dir, MemoryStrategy allocator_strategy)
Definition: graph_db.cc:460
std::shared_ptr< ColumnBase > get_column(const std::string &name)
Definition: table.cc:171
void UpdateCompactionTimestamp(timestamp_t ts)
Definition: graph_db.cc:309
void OutputCypherProfiles(const std::string &prefix)
Definition: graph_db.cc:524