Go to the documentation of this file.
16 #ifndef GRAPHSCOPE_DATABASE_GRAPH_DB_SESSION_H_
17 #define GRAPHSCOPE_DATABASE_GRAPH_DB_SESSION_H_
52 const std::string& work_dir,
int thread_id)
60 for (
auto& app :
apps_) {
87 uint8_t label,
const std::string& col_name)
const;
142 const std::string& input) {
143 const char* str_data = input.data();
144 VLOG(10) <<
"parse query type for " << input <<
" size: " << input.size();
145 char input_tag = input.back();
146 VLOG(10) <<
"input tag: " <<
static_cast<int>(input_tag);
147 size_t len = input.size();
151 return std::make_pair((uint8_t) input[len - 2],
152 std::string_view(str_data, len - 2));
153 }
else if (input_tag ==
158 return std::make_pair((uint8_t) input[len - 2],
159 std::string_view(str_data, len - 2));
165 std::string_view str_view(input.data(), len);
167 }
else if (input_tag ==
172 std::string_view str_view(input.data(), len);
187 std::array<AppBase*, MAX_PLUGIN_NUM>
apps_;
196 #endif // GRAPHSCOPE_DATABASE_GRAPH_DB_SESSION_H_
std::array< AppBase *, MAX_PLUGIN_NUM > apps_
Definition: graph_db_session.h:187
static constexpr const char * kCppEncoderStr
Definition: graph_db_session.h:47
Result< std::vector< char > > Eval(const std::string &input)
Definition: graph_db_session.cc:85
static constexpr const char * kCypherProtoAdhocStr
Definition: graph_db_session.h:49
void GetAppInfo(Encoder &result)
Definition: graph_db_session.cc:164
SingleEdgeInsertTransaction GetSingleEdgeInsertTransaction()
Definition: graph_db_session.cc:48
const AppMetric & GetAppMetric(int idx) const
Definition: graph_db_session.cc:286
GraphDB & db_
Definition: graph_db_session.h:180
Definition: compact_transaction.h:28
Allocator & alloc_
Definition: graph_db_session.h:181
AppBase * GetApp(int idx)
Definition: graph_db_session.cc:202
Result< std::pair< uint8_t, std::string_view > > parse_query_type_from_cypher_internal(const std::string_view &input)
Definition: graph_db_session.cc:256
WalWriter & logger_
Definition: graph_db_session.h:182
InputFormat
Definition: graph_db_session.h:38
Definition: insert_transaction.h:32
const GraphDB & db() const
Definition: graph_db_session.cc:69
std::string to_string(const gs::flex::interactive::Code &status)
Definition: result.h:166
Definition: adj_list.h:23
GraphDBSession(GraphDB &db, Allocator &alloc, WalWriter &logger, const std::string &work_dir, int thread_id)
Definition: graph_db_session.h:51
UpdateTransaction GetUpdateTransaction()
Definition: graph_db_session.cc:54
std::shared_ptr< RefColumnBase > get_vertex_id_column(uint8_t label) const
Definition: graph_db_session.cc:80
ReadTransaction GetReadTransaction() const
Definition: graph_db_session.cc:30
Definition: app_utils.h:25
std::atomic< int64_t > query_num_
Definition: graph_db_session.h:191
Definition: single_edge_insert_transaction.h:30
Definition: allocators.h:29
bool Compact()
Definition: graph_db_session.cc:173
Definition: mutable_property_fragment.h:37
~GraphDBSession()
Definition: graph_db_session.h:64
const MutablePropertyFragment & graph() const
Definition: graph_db_session.cc:65
Result< std::pair< uint8_t, std::string_view > > parse_query_type_from_cypher_json(const std::string_view &input)
Definition: graph_db_session.cc:229
Definition: app_base.h:35
std::atomic< int64_t > eval_duration_
Definition: graph_db_session.h:190
bool BatchUpdate(UpdateBatch &batch)
Definition: graph_db_session.cc:60
Definition: graph_db_session.h:36
Definition: graph_db.h:70
SingleVertexInsertTransaction GetSingleVertexInsertTransaction()
Definition: graph_db_session.cc:42
int thread_id_
Definition: graph_db_session.h:184
std::array< AppMetric, MAX_PLUGIN_NUM > app_metrics_
Definition: graph_db_session.h:188
Definition: read_transaction.h:278
Definition: single_vertex_insert_transaction.h:30
int64_t query_num() const
Definition: graph_db_session.cc:189
std::array< AppWrapper, MAX_PLUGIN_NUM > app_wrappers_
Definition: graph_db_session.h:186
static constexpr const char * kCypherProtoProcedureStr
Definition: graph_db_session.h:50
static constexpr int32_t MAX_PLUGIN_NUM
Definition: graph_db_session.h:46
InsertTransaction GetInsertTransaction()
Definition: graph_db_session.cc:35
Result< std::pair< uint8_t, std::string_view > > parse_query_type(const std::string &input)
Parse the input format of the query. There are four formats: 0. CppEncoder: This format will be used ...
Definition: graph_db_session.h:141
static constexpr int32_t MAX_RETRY
Definition: graph_db_session.h:45
std::string work_dir_
Definition: graph_db_session.h:183
const Schema & schema() const
Definition: graph_db_session.cc:73
Definition: update_transaction.h:38
int SessionId() const
Definition: graph_db_session.cc:166
double eval_duration() const
Definition: graph_db_session.cc:185
CompactTransaction GetCompactTransaction()
Definition: graph_db_session.cc:168
static constexpr const char * kCypherJsonStr
Definition: graph_db_session.h:48
Definition: app_base.h:139
Definition: transaction_utils.h:113
std::shared_ptr< ColumnBase > get_vertex_property_column(uint8_t label, const std::string &col_name) const
Definition: graph_db_session.cc:75