Commit Graph

706 Commits

Author SHA1 Message Date
Dominik Gleich
2032466e2a New version of scheduler.
Summary: New scheduler declaration.

Reviewers: matej.gradicek, buda

Reviewed By: matej.gradicek

Differential Revision: https://phabricator.memgraph.io/D246
2017-04-07 11:55:10 +02:00
Dominik Gleich
74740dd162 Fix gradiceks mess.
Summary: Fix fix fix.

Reviewers: matej.gradicek

Reviewed By: matej.gradicek

Differential Revision: https://phabricator.memgraph.io/D245
2017-04-07 10:55:40 +02:00
Matej Ferencevic
22dfe61fe1 Added socket write verification to bolt buffer.
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D199
2017-04-07 10:06:55 +02:00
Matej Ferencevic
72f7b64c8f Logger in this test somehow breaks code coverage. Argh...
Reviewers: buda, dgleich

Reviewed By: dgleich

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D240
2017-04-07 09:44:12 +02:00
Teon Banek
984c898cfe init: Add optional & required dependency checking
Reviewers: mferencevic, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D238
2017-04-07 09:27:12 +02:00
Dominik Gleich
ebff4687a1 Default should be the compiler for the test.
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D241
2017-04-06 16:12:55 +02:00
Dominik Gleich
e8fe25bc61 Remove move constructor and delete move =
Reviewers: florijan, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D237
2017-04-06 14:38:48 +02:00
Matej Ferencevic
e5c814e022 First version of new bolt decoder and tests.
Summary:
Extracted constants to codes.hpp.

Extracted bolt constants.

Extracted StreamBuffer and fixed data type.

Extracted bolt testdata.

Added bolt buffer and tests.

Added bolt decoder buffer and tests.

Renamed bolt testdata.

Reviewers: dgleich, buda, matej.gradicek

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D220
2017-04-06 14:30:19 +02:00
Teon Banek
aa6cae0b16 Plan WITH clause without aggregation
Summary: Generate symbols for WITH clause.

Reviewers: florijan, mislav.bradac, buda

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D231
2017-04-06 14:10:28 +02:00
Dominik Gleich
919258d6f6 Fix integration_engine crash.
Summary:
This should fix the integration query engine test. I'm not exactly sure what caused the SEGFAULT to occur, but from my debugging sessions; I would say, as an educated guess that it's closely related to logger. What I believe happens is that logger gets somehow initialized from the dynamic_library when it's opened. And when the library is closed the corresponding logger is freed, but, other parts of memgraph still see that instance of logger and trying to use to emit code makes the whole thing crash. I've removed one include of logger from something which gets included in the hardcoded queries, but I noticed there are some more.

I've changed the dlopen to now open with DEEPBIND, which should cause symbols to be resolved locally and not globally and stop the logger from the dynamic lib to interfer with the one used in the rest of memgraph.

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D234
2017-04-06 11:49:12 +02:00
florijan
feee6ed80e Query::Plan::Aggregate API
Reviewers: mislav.bradac, buda, teon.banek

Reviewed By: mislav.bradac, teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D229
2017-04-06 09:38:24 +02:00
Mislav Bradac
f7f44a3e81 Bug fix in interpreter (dynamic wrong cast type)
Reviewers: buda, florijan

Reviewed By: buda

Differential Revision: https://phabricator.memgraph.io/D233
2017-04-05 18:03:09 +02:00
Dominik Gleich
8c7ed8c186 Add edge_types indexes.
Summary: Refactor label_index. Also add edge_type indexes.

Reviewers: mislav.bradac, florijan

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D217
2017-04-05 17:23:12 +02:00
Mislav Bradac
a0049c9691 Convert With clause from antlr to high level ast
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D230
2017-04-05 16:22:46 +02:00
florijan
4c73a0a71c Query::Plan::Accumulate[Advance] implementation and test
Summary: see above

Reviewers: teon.banek, buda, mislav.bradac

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D226
2017-04-05 15:04:58 +02:00
matej.gradicek
5243ab00c2 Scheduler and tests.
Reviewers: dgleich, buda

Reviewed By: dgleich, buda

Subscribers: pullbot, matej.gradicek

Differential Revision: https://phabricator.memgraph.io/D213
2017-04-05 08:43:43 +00:00
florijan
263749508c Query::Plan - WITH API
Reviewers: teon.banek, buda

Reviewed By: teon.banek

Differential Revision: https://phabricator.memgraph.io/D224
2017-04-05 10:35:28 +02:00
Teon Banek
b33b671505 Plan multiple MATCH clauses and multiple patterns
Reviewers: mislav.bradac, florijan

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D218
2017-04-05 09:23:03 +02:00
Mislav Bradac
6112454b08 Throw exception on trailing text in query
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D222
2017-04-04 18:48:55 +02:00
Mislav Bradac
13aafa35cf Fix hardcoded query bug
Reviewers: buda

Reviewed By: buda

Differential Revision: https://phabricator.memgraph.io/D223
2017-04-04 18:47:42 +02:00
Mislav Bradac
a58e269176 Fix bugs needed to run qa tests
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D216
2017-04-04 17:28:08 +02:00
florijan
e2949a88ce Storage::EdgeAccessor::set_edge_type removed
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D221
2017-04-04 16:58:30 +02:00
florijan
9eb4428023 Query::Plan::ScanAll accepts optional input (for cartesian)
Reviewers: buda, mislav.bradac, teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D219
2017-04-04 16:58:05 +02:00
florijan
bffc406662 Query::Plan - ExpansionUniquenessFilter
Reviewers: buda, mislav.bradac, teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D214
2017-04-04 12:20:01 +02:00
Teon Banek
c09d237e05 Use doxygen style comments for Visitor and Visitable
Summary: Update the documentation to be picked up by doxygen. Additionally, don't use anonymous namespace in header file.

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D212
2017-04-03 16:17:54 +02:00
florijan
0a47bace72 Query::Interpreter-added support for missing ops
Reviewers: teon.banek, buda

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D215
2017-04-03 16:11:36 +02:00
Teon Banek
05d19f6218 Use new/old on Accessor in logical operators
Summary:
Replace includes in operator.hpp with forward declarations.
Provide basic documentation for remaining operators.
Use SwitchOld on accessors used in Expand and Filter operations.
Add SwitchOld and SwitchNew to ExpressionEvaluator.
Evaluate new or old state in operators.
Test operators use correct accessors.
Add some basic tests for cases where switching accessors to old and new
matters.

Reviewers: mislav.bradac, buda, florijan

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D208
2017-04-03 15:37:06 +02:00
florijan
9ce2081103 Storage::RecordAccessor - added multiple pointers to RecordAcessors and switching capabilities. Rewired GraphDbAccessor and VersionList accordingly. Added tests for new RecordAccessor functions.
Reviewers: teon.banek, dtomicevic, mislav.bradac, dgleich, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D207
2017-04-03 12:29:56 +02:00
Dominik Gleich
863f55dc2f Labels implementation.
Summary: Labels implementation

Reviewers: buda, teon.banek

Reviewed By: buda, teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D201
2017-04-03 11:50:22 +02:00
Dominik Gleich
3ad55dd352 Fix config include in GC. This somehow breaks integration_query_engine. Argh.
Reviewers: mislav.bradac, mferencevic

Reviewed By: mferencevic

Differential Revision: https://phabricator.memgraph.io/D211
2017-03-31 16:59:24 +02:00
Dominik Gleich
4a6d17658c Fix unnecessary multiple inserts.
Summary: Unnecessary inserts into skiplist. Skiplist when calls insert alredy blocks untill it inserts or finds that record.

Reviewers: mislav.bradac, teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D210
2017-03-31 14:02:54 +02:00
Dominik Gleich
67d916e459 Logger fix.
Summary: This should be a temporary fix for logger. We won't emit anything. This is useful in case tests don't initialize logger.

Reviewers: mferencevic, buda, teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D209
2017-03-31 13:00:43 +02:00
Teon Banek
a3da7cd5a8 Plan Remove operators
Reviewers: florijan, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D203
2017-03-30 13:56:25 +02:00
florijan
078b50a154 Storage::RecordAccessor - added SwitchNew, SwitchOld and Reconstruct API and placeholder implementations
Reviewers: teon.banek, mislav.bradac, buda

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D205
2017-03-30 13:49:17 +02:00
florijan
d3692d439c Query::Plan::Operator - split into hpp and cpp
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D204
2017-03-30 13:48:16 +02:00
Dominik Gleich
cac422f6a8 Fix conditional wait.
Summary: It could happen that the garbage collector waits for the sleep period before exiting thread since notify_one wasn't done after mutex locking.

Reviewers: mislav.bradac

Reviewed By: mislav.bradac

Differential Revision: https://phabricator.memgraph.io/D206
2017-03-30 13:26:08 +02:00
Matej Ferencevic
3d2b37ed35 Split bolt encoder into two.
Summary:
Added temporary_id to record_accessor.

Added ID encoding to encoder.

Reviewers: florijan

Reviewed By: florijan

Subscribers: pullbot, matej.gradicek

Differential Revision: https://phabricator.memgraph.io/D197
2017-03-30 09:59:47 +02:00
florijan
5134a94f1c Query::Plan - RemoveLabels added and tested
Summary:
Query::Plan::RemoveProperty op added and tested

Query::AST:: Remove added to cypher main visitor. Tested. Grammar corrected on missing whitespace in removeItem production

Reviewers: buda, mislav.bradac, teon.banek

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D202
2017-03-30 08:53:18 +02:00
Dominik Gleich
bd0b81526e Initial version of mvcc_gc.
Summary:
Tested MVCC garbage collector.
Also refactors graph_db forward declarations of vertex and edge which were causing issues.

Reviewers: mislav.bradac, dtomicevic, florijan, teon.banek, buda

Reviewed By: teon.banek, buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D177
2017-03-29 12:38:24 +02:00
Dominik Gleich
45999d04be Fix mvcc bug.
Summary: Changing mvcc again. This should be double-checked since it's quite a substantial change. The test here tests for the new behaviour - which should be correct.

Reviewers: matej.gradicek, dtomicevic, buda

Reviewed By: matej.gradicek, buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D156
2017-03-29 10:50:52 +02:00
florijan
1303097cdd Query::Plan - removed tuples from test for clarity
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D196
2017-03-29 09:18:02 +02:00
Teon Banek
9d3b4aab4b Make Where and NamedExpression macros easier to use
Summary:
`Where` can now be constructed in a `QUERY`, instead of requiring manual
addition to `Match`. For example:

    auto query = QUERY(MATCH(pattern), WHERE(expr), ...);

compared to:

    auto match = MATCH(pattern);
    match->where_ = WHERE(expr);
    auto query = QUERY(match, ...);

Similarly, `AS` can be used instead of `NEXPR` to create
`NamedExpressions` only with a name. This is meant to be used with
`RETURN` which will look at the previous `Expression` and store it
inside `NamedExpression`. For example:

    auto ret = RETURN(IDENT("n"), AS("n"),
                      PROPERTY_LOOKUP("n", prop), AS("prop_val"));

compared to:

    auto ret = RETURN(NEXPR("n", IDENT("n")),
                      NEXPR("prop_val", PROPERTY_LOOKUP("n", prop)));

Reviewers: florijan, mislav.bradac

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D195
2017-03-29 09:09:54 +02:00
florijan
af8df9e282 Query::Plan - Set logical ops implementation and testing. PropertyValueStore set() overriden to handle Null values as a removal instead of setting them. PropertyValueStore.clear() function added.
Reviewers: buda, teon.banek, mislav.bradac

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D194
2017-03-29 08:51:12 +02:00
Marko Budiselic
d00c08bf15 Bolt PullAll works.
Summary: Bolt PullAll works. ChunkedBuffer is implemented by the specification (the tests can be found in the tests/unit/bolt_chunked_buffer.cpp). Bolt session states method are refactored (all run methods have only one argument - active Session). Modifications related to the style guide.

Reviewers: mferencevic

Reviewed By: mferencevic

Subscribers: pullbot, buda

Differential Revision: https://phabricator.memgraph.io/D180
2017-03-28 12:43:04 +02:00
Teon Banek
68e94e64e4 Plan set operations
Summary:
Inline and remove GenProduce.
It doesn't do anything useful, so instantiating `Produce` can be done
inline.

Add dummy MakeCursor overrides for set operators so that the build passes.

Reviewers: florijan, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D193
2017-03-28 12:23:52 +02:00
Mislav Bradac
e40bd83636 Add SET conversion from low to highlevel ast
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D192
2017-03-28 10:56:20 +02:00
Teon Banek
7c36529aec Move Variable::Type to Symbol
Reviewers: florijan, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D191
2017-03-28 10:43:53 +02:00
florijan
7b81b2b132 Query::Plan::Set - set ops API defined. ConsoleTest random graph generation modified
Reviewers: teon.banek, mislav.bradac, buda

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D190
2017-03-28 09:39:06 +02:00
Teon Banek
d9500337f2 Add planning Delete operation
Reviewers: florijan, mislav.bradac

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D188
2017-03-27 16:30:35 +02:00
Teon Banek
4bfae46150 Add basic planning of WHERE
Summary:
Add testing unbound variable in WHERE

Remove some duplication in planner tests

Reviewers: florijan, mislav.bradac

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D186
2017-03-27 16:02:24 +02:00