Flex  0.17.9
cypher_write_app.h
Go to the documentation of this file.
1 
16 #ifndef ENGINES_GRAPH_DB_CYPHER_WRITE_APP_H_
17 #define ENGINES_GRAPH_DB_CYPHER_WRITE_APP_H_
20 #include "flex/engines/graph_db/runtime/execute/pipeline.h"
21 
22 #include "flex/proto_generated_gie/physical.pb.h"
23 
24 namespace gs {
25 class CypherWriteApp : public WriteAppBase {
26  public:
27  CypherWriteApp(const GraphDB& db) : db_(db) {}
28 
29  AppType type() const override { return AppType::kCypherAdhoc; }
30 
31  bool Query(GraphDBSession& graph, Decoder& input, Encoder& output) override;
32 
33  const runtime::OprTimer& timer() const { return timer_; }
34  runtime::OprTimer& timer() { return timer_; }
35 
36  private:
37  const GraphDB& db_;
38  std::unordered_map<std::string, physical::PhysicalPlan> plan_cache_;
39  std::unordered_map<std::string, runtime::InsertPipeline> pipeline_cache_;
40  runtime::OprTimer timer_;
41 };
42 
44  public:
45  CypherWriteAppFactory() = default;
46  ~CypherWriteAppFactory() = default;
47 
48  AppWrapper CreateApp(const GraphDB& db) override;
49 };
50 
51 } // namespace gs
52 #endif // ENGINES_GRAPH_DB_CYPHER_WRITE_APP_H_
gs::CypherWriteApp::timer_
runtime::OprTimer timer_
Definition: cypher_write_app.h:40
gs::CypherWriteApp::timer
runtime::OprTimer & timer()
Definition: cypher_write_app.h:34
graph_db_session.h
gs::CypherWriteAppFactory::~CypherWriteAppFactory
~CypherWriteAppFactory()=default
gs::CypherWriteAppFactory::CreateApp
AppWrapper CreateApp(const GraphDB &db) override
Definition: cypher_write_app.cc:51
gs::CypherWriteApp::type
AppType type() const override
Definition: cypher_write_app.h:29
gs::CypherWriteApp::timer
const runtime::OprTimer & timer() const
Definition: cypher_write_app.h:33
gs
Definition: adj_list.h:23
gs::CypherWriteApp::pipeline_cache_
std::unordered_map< std::string, runtime::InsertPipeline > pipeline_cache_
Definition: cypher_write_app.h:39
gs::Encoder
Definition: app_utils.h:25
gs::Decoder
Definition: app_utils.h:69
gs::CypherWriteApp
Definition: cypher_write_app.h:25
gs::WriteAppBase
Definition: app_base.h:67
gs::GraphDBSession
Definition: graph_db_session.h:36
gs::GraphDB
Definition: graph_db.h:77
gs::CypherWriteAppFactory
Definition: cypher_write_app.h:43
gs::CypherWriteApp::Query
bool Query(GraphDBSession &graph, Decoder &input, Encoder &output) override
Definition: cypher_write_app.cc:10
gs::CypherWriteApp::CypherWriteApp
CypherWriteApp(const GraphDB &db)
Definition: cypher_write_app.h:27
gs::CypherWriteApp::plan_cache_
std::unordered_map< std::string, physical::PhysicalPlan > plan_cache_
Definition: cypher_write_app.h:38
gs::AppWrapper
Definition: app_base.h:78
gs::AppBase::AppType::kCypherAdhoc
@ kCypherAdhoc
app_base.h
gs::AppBase::AppType
AppType
Definition: app_base.h:37
gs::CypherWriteAppFactory::CypherWriteAppFactory
CypherWriteAppFactory()=default
gs::AppFactoryBase
Definition: app_base.h:115
gs::CypherWriteApp::db_
const GraphDB & db_
Definition: cypher_write_app.h:37