Separate distributed implementation of GraphDbAccessor

Summary:
GraphDbAccessor is now constructed only through GraphDb. This allows the
concrete GraphDb to instantiate a concrete GraphDbAccessor. This allows
us to use virtual calls, so that the implementation may be kept
separate. The major downside of doing things this way is heap allocation
of GraphDbAccessor. In case it turns out to be a real performance
issues, another solution with pointer to static implementation may be
used.

InsertVertexIntoRemote is now a non-member function, which reduces
coupling. It made no sense for it to be member function because it used
only the public parts of GraphDbAccessor.

Reviewers: msantl, mtomic, mferencevic

Reviewed By: msantl

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1504
This commit is contained in:
Teon Banek
2018-07-26 09:08:21 +02:00
parent e28fd2025d
commit 9f460914ed
74 changed files with 2279 additions and 2037 deletions

View File

@@ -18,7 +18,8 @@ using namespace query;
class TestSymbolGenerator : public ::testing::Test {
protected:
database::SingleNode db;
database::GraphDbAccessor dba{db};
std::unique_ptr<database::GraphDbAccessor> dba_ptr{db.Access()};
database::GraphDbAccessor &dba{*dba_ptr};
SymbolTable symbol_table;
SymbolGenerator symbol_generator{symbol_table};
AstStorage storage;