2018-10-04 21:23:07 +08:00
|
|
|
#include <gtest/gtest.h>
|
LabelProperty index.
Summary:
Add return values.
After merge.
Inital working version. Still missing comments.
Update documentation.
Add checking for previous vlist and value equality.
After merge.
Remove functor, add boolean ffunction.
Build index.
More functionality. Start implementing tests.
Add tests.
Reviewers: matej.gradicek, mislav.bradac, mferencevic, buda, florijan
Reviewed By: mislav.bradac, buda, florijan
Subscribers: lion, florijan, teon.banek, buda, pullbot
Differential Revision: https://phabricator.memgraph.io/D355
2017-05-16 20:47:03 +08:00
|
|
|
|
2018-10-05 18:37:23 +08:00
|
|
|
#include "database/single_node/graph_db.hpp"
|
|
|
|
#include "database/single_node/graph_db_accessor.hpp"
|
2018-11-07 01:15:55 +08:00
|
|
|
#include "storage/common/types/types.hpp"
|
2018-10-04 21:23:07 +08:00
|
|
|
#include "storage/single_node/indexes/label_property_index.hpp"
|
2018-10-09 17:09:10 +08:00
|
|
|
#include "transactions/single_node/engine.hpp"
|
LabelProperty index.
Summary:
Add return values.
After merge.
Inital working version. Still missing comments.
Update documentation.
Add checking for previous vlist and value equality.
After merge.
Remove functor, add boolean ffunction.
Build index.
More functionality. Start implementing tests.
Add tests.
Reviewers: matej.gradicek, mislav.bradac, mferencevic, buda, florijan
Reviewed By: mislav.bradac, buda, florijan
Subscribers: lion, florijan, teon.banek, buda, pullbot
Differential Revision: https://phabricator.memgraph.io/D355
2017-05-16 20:47:03 +08:00
|
|
|
|
2017-06-12 16:21:19 +08:00
|
|
|
#include "mvcc_gc_common.hpp"
|
|
|
|
|
2018-01-12 22:17:04 +08:00
|
|
|
using namespace database;
|
|
|
|
|
LabelProperty index.
Summary:
Add return values.
After merge.
Inital working version. Still missing comments.
Update documentation.
Add checking for previous vlist and value equality.
After merge.
Remove functor, add boolean ffunction.
Build index.
More functionality. Start implementing tests.
Add tests.
Reviewers: matej.gradicek, mislav.bradac, mferencevic, buda, florijan
Reviewed By: mislav.bradac, buda, florijan
Subscribers: lion, florijan, teon.banek, buda, pullbot
Differential Revision: https://phabricator.memgraph.io/D355
2017-05-16 20:47:03 +08:00
|
|
|
class LabelPropertyIndexComplexTest : public ::testing::Test {
|
|
|
|
protected:
|
|
|
|
virtual void SetUp() {
|
2018-07-26 15:08:21 +08:00
|
|
|
auto accessor = db_.Access();
|
LabelProperty index.
Summary:
Add return values.
After merge.
Inital working version. Still missing comments.
Update documentation.
Add checking for previous vlist and value equality.
After merge.
Remove functor, add boolean ffunction.
Build index.
More functionality. Start implementing tests.
Add tests.
Reviewers: matej.gradicek, mislav.bradac, mferencevic, buda, florijan
Reviewed By: mislav.bradac, buda, florijan
Subscribers: lion, florijan, teon.banek, buda, pullbot
Differential Revision: https://phabricator.memgraph.io/D355
2017-05-16 20:47:03 +08:00
|
|
|
|
2019-04-15 17:36:43 +08:00
|
|
|
label = accessor.Label("label");
|
|
|
|
property = accessor.Property("property");
|
|
|
|
label2 = accessor.Label("label2");
|
|
|
|
property2 = accessor.Property("property2");
|
LabelProperty index.
Summary:
Add return values.
After merge.
Inital working version. Still missing comments.
Update documentation.
Add checking for previous vlist and value equality.
After merge.
Remove functor, add boolean ffunction.
Build index.
More functionality. Start implementing tests.
Add tests.
Reviewers: matej.gradicek, mislav.bradac, mferencevic, buda, florijan
Reviewed By: mislav.bradac, buda, florijan
Subscribers: lion, florijan, teon.banek, buda, pullbot
Differential Revision: https://phabricator.memgraph.io/D355
2017-05-16 20:47:03 +08:00
|
|
|
|
|
|
|
key = new LabelPropertyIndex::Key(label, property);
|
|
|
|
EXPECT_EQ(index.CreateIndex(*key), true);
|
|
|
|
|
2017-06-12 16:21:19 +08:00
|
|
|
t = engine.Begin();
|
2018-10-11 17:37:59 +08:00
|
|
|
vlist = new mvcc::VersionList<Vertex>(*t, 0);
|
2017-06-12 16:21:19 +08:00
|
|
|
engine.Advance(t->id_);
|
LabelProperty index.
Summary:
Add return values.
After merge.
Inital working version. Still missing comments.
Update documentation.
Add checking for previous vlist and value equality.
After merge.
Remove functor, add boolean ffunction.
Build index.
More functionality. Start implementing tests.
Add tests.
Reviewers: matej.gradicek, mislav.bradac, mferencevic, buda, florijan
Reviewed By: mislav.bradac, buda, florijan
Subscribers: lion, florijan, teon.banek, buda, pullbot
Differential Revision: https://phabricator.memgraph.io/D355
2017-05-16 20:47:03 +08:00
|
|
|
|
|
|
|
vertex = vlist->find(*t);
|
|
|
|
ASSERT_NE(vertex, nullptr);
|
|
|
|
vertex->labels_.push_back(label);
|
2018-06-12 17:29:22 +08:00
|
|
|
vertex->properties_.set(property, PropertyValue(0));
|
LabelProperty index.
Summary:
Add return values.
After merge.
Inital working version. Still missing comments.
Update documentation.
Add checking for previous vlist and value equality.
After merge.
Remove functor, add boolean ffunction.
Build index.
More functionality. Start implementing tests.
Add tests.
Reviewers: matej.gradicek, mislav.bradac, mferencevic, buda, florijan
Reviewed By: mislav.bradac, buda, florijan
Subscribers: lion, florijan, teon.banek, buda, pullbot
Differential Revision: https://phabricator.memgraph.io/D355
2017-05-16 20:47:03 +08:00
|
|
|
|
|
|
|
EXPECT_EQ(index.Count(*key), 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void TearDown() {
|
|
|
|
delete key;
|
|
|
|
delete vlist;
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
2018-10-09 17:09:10 +08:00
|
|
|
GraphDb db_;
|
LabelProperty index.
Summary:
Add return values.
After merge.
Inital working version. Still missing comments.
Update documentation.
Add checking for previous vlist and value equality.
After merge.
Remove functor, add boolean ffunction.
Build index.
More functionality. Start implementing tests.
Add tests.
Reviewers: matej.gradicek, mislav.bradac, mferencevic, buda, florijan
Reviewed By: mislav.bradac, buda, florijan
Subscribers: lion, florijan, teon.banek, buda, pullbot
Differential Revision: https://phabricator.memgraph.io/D355
2017-05-16 20:47:03 +08:00
|
|
|
LabelPropertyIndex index;
|
|
|
|
LabelPropertyIndex::Key *key;
|
|
|
|
|
2018-10-09 17:09:10 +08:00
|
|
|
tx::Engine engine;
|
LabelProperty index.
Summary:
Add return values.
After merge.
Inital working version. Still missing comments.
Update documentation.
Add checking for previous vlist and value equality.
After merge.
Remove functor, add boolean ffunction.
Build index.
More functionality. Start implementing tests.
Add tests.
Reviewers: matej.gradicek, mislav.bradac, mferencevic, buda, florijan
Reviewed By: mislav.bradac, buda, florijan
Subscribers: lion, florijan, teon.banek, buda, pullbot
Differential Revision: https://phabricator.memgraph.io/D355
2017-05-16 20:47:03 +08:00
|
|
|
tx::Transaction *t{nullptr};
|
|
|
|
|
|
|
|
mvcc::VersionList<Vertex> *vlist;
|
|
|
|
Vertex *vertex;
|
|
|
|
|
2018-01-16 17:09:15 +08:00
|
|
|
storage::Label label;
|
|
|
|
storage::Property property;
|
|
|
|
storage::Label label2;
|
|
|
|
storage::Property property2;
|
LabelProperty index.
Summary:
Add return values.
After merge.
Inital working version. Still missing comments.
Update documentation.
Add checking for previous vlist and value equality.
After merge.
Remove functor, add boolean ffunction.
Build index.
More functionality. Start implementing tests.
Add tests.
Reviewers: matej.gradicek, mislav.bradac, mferencevic, buda, florijan
Reviewed By: mislav.bradac, buda, florijan
Subscribers: lion, florijan, teon.banek, buda, pullbot
Differential Revision: https://phabricator.memgraph.io/D355
2017-05-16 20:47:03 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
TEST(LabelPropertyIndex, CreateIndex) {
|
2018-10-09 17:09:10 +08:00
|
|
|
GraphDb db;
|
2018-07-26 15:08:21 +08:00
|
|
|
auto accessor = db.Access();
|
2019-04-15 17:36:43 +08:00
|
|
|
LabelPropertyIndex::Key key(accessor.Label("test"),
|
|
|
|
accessor.Property("test2"));
|
LabelProperty index.
Summary:
Add return values.
After merge.
Inital working version. Still missing comments.
Update documentation.
Add checking for previous vlist and value equality.
After merge.
Remove functor, add boolean ffunction.
Build index.
More functionality. Start implementing tests.
Add tests.
Reviewers: matej.gradicek, mislav.bradac, mferencevic, buda, florijan
Reviewed By: mislav.bradac, buda, florijan
Subscribers: lion, florijan, teon.banek, buda, pullbot
Differential Revision: https://phabricator.memgraph.io/D355
2017-05-16 20:47:03 +08:00
|
|
|
LabelPropertyIndex index;
|
|
|
|
EXPECT_EQ(index.CreateIndex(key), true);
|
|
|
|
EXPECT_EQ(index.CreateIndex(key), false);
|
|
|
|
}
|
|
|
|
|
2018-01-26 00:19:33 +08:00
|
|
|
TEST(LabelPropertyIndex, DeleteIndex) {
|
2018-10-09 17:09:10 +08:00
|
|
|
GraphDb db;
|
2018-07-26 15:08:21 +08:00
|
|
|
auto accessor = db.Access();
|
2019-04-15 17:36:43 +08:00
|
|
|
LabelPropertyIndex::Key key(accessor.Label("test"),
|
|
|
|
accessor.Property("test2"));
|
2018-01-26 00:19:33 +08:00
|
|
|
LabelPropertyIndex index;
|
|
|
|
EXPECT_EQ(index.CreateIndex(key), true);
|
|
|
|
EXPECT_EQ(index.CreateIndex(key), false);
|
|
|
|
index.DeleteIndex(key);
|
|
|
|
EXPECT_EQ(index.CreateIndex(key), true);
|
|
|
|
}
|
|
|
|
|
LabelProperty index.
Summary:
Add return values.
After merge.
Inital working version. Still missing comments.
Update documentation.
Add checking for previous vlist and value equality.
After merge.
Remove functor, add boolean ffunction.
Build index.
More functionality. Start implementing tests.
Add tests.
Reviewers: matej.gradicek, mislav.bradac, mferencevic, buda, florijan
Reviewed By: mislav.bradac, buda, florijan
Subscribers: lion, florijan, teon.banek, buda, pullbot
Differential Revision: https://phabricator.memgraph.io/D355
2017-05-16 20:47:03 +08:00
|
|
|
TEST(LabelPropertyIndex, IndexExistance) {
|
2018-10-09 17:09:10 +08:00
|
|
|
GraphDb db;
|
2018-07-26 15:08:21 +08:00
|
|
|
auto accessor = db.Access();
|
2019-04-15 17:36:43 +08:00
|
|
|
LabelPropertyIndex::Key key(accessor.Label("test"),
|
|
|
|
accessor.Property("test2"));
|
LabelProperty index.
Summary:
Add return values.
After merge.
Inital working version. Still missing comments.
Update documentation.
Add checking for previous vlist and value equality.
After merge.
Remove functor, add boolean ffunction.
Build index.
More functionality. Start implementing tests.
Add tests.
Reviewers: matej.gradicek, mislav.bradac, mferencevic, buda, florijan
Reviewed By: mislav.bradac, buda, florijan
Subscribers: lion, florijan, teon.banek, buda, pullbot
Differential Revision: https://phabricator.memgraph.io/D355
2017-05-16 20:47:03 +08:00
|
|
|
LabelPropertyIndex index;
|
|
|
|
EXPECT_EQ(index.CreateIndex(key), true);
|
|
|
|
// Index doesn't exist - and can't be used untill it's been notified as built.
|
|
|
|
EXPECT_EQ(index.IndexExists(key), true);
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST(LabelPropertyIndex, Count) {
|
2018-10-09 17:09:10 +08:00
|
|
|
GraphDb db;
|
2018-07-26 15:08:21 +08:00
|
|
|
auto accessor = db.Access();
|
2019-04-15 17:36:43 +08:00
|
|
|
auto label = accessor.Label("label");
|
|
|
|
auto property = accessor.Property("property");
|
LabelProperty index.
Summary:
Add return values.
After merge.
Inital working version. Still missing comments.
Update documentation.
Add checking for previous vlist and value equality.
After merge.
Remove functor, add boolean ffunction.
Build index.
More functionality. Start implementing tests.
Add tests.
Reviewers: matej.gradicek, mislav.bradac, mferencevic, buda, florijan
Reviewed By: mislav.bradac, buda, florijan
Subscribers: lion, florijan, teon.banek, buda, pullbot
Differential Revision: https://phabricator.memgraph.io/D355
2017-05-16 20:47:03 +08:00
|
|
|
LabelPropertyIndex::Key key(label, property);
|
|
|
|
LabelPropertyIndex index;
|
|
|
|
EXPECT_EQ(index.CreateIndex(key), true);
|
|
|
|
EXPECT_EQ(index.Count(key), 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Add on label+property to index.
|
|
|
|
TEST_F(LabelPropertyIndexComplexTest, UpdateOnLabelPropertyTrue) {
|
|
|
|
index.UpdateOnLabelProperty(vlist, vertex);
|
|
|
|
EXPECT_EQ(index.Count(*key), 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Try adding on label+property but fail because labels are clear.
|
|
|
|
TEST_F(LabelPropertyIndexComplexTest, UpdateOnLabelPropertyFalse) {
|
|
|
|
vertex->labels_.clear();
|
|
|
|
index.UpdateOnLabelProperty(vlist, vertex);
|
|
|
|
EXPECT_EQ(index.Count(*key), 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Add on label to index.
|
|
|
|
TEST_F(LabelPropertyIndexComplexTest, UpdateOnLabelTrue) {
|
|
|
|
index.UpdateOnLabel(label, vlist, vertex);
|
|
|
|
EXPECT_EQ(index.Count(*key), 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Try adding on label but fail because label is wrong.
|
|
|
|
TEST_F(LabelPropertyIndexComplexTest, UpdateOnLabelFalse) {
|
|
|
|
index.UpdateOnLabel(label2, vlist, vertex);
|
|
|
|
EXPECT_EQ(index.Count(*key), 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Add on property to index.
|
|
|
|
TEST_F(LabelPropertyIndexComplexTest, UpdateOnPropertyTrue) {
|
|
|
|
index.UpdateOnProperty(property, vlist, vertex);
|
|
|
|
EXPECT_EQ(index.Count(*key), 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Try adding on property but fail because property is wrong.
|
|
|
|
TEST_F(LabelPropertyIndexComplexTest, UpdateOnPropertyFalse) {
|
|
|
|
index.UpdateOnProperty(property2, vlist, vertex);
|
|
|
|
EXPECT_EQ(index.Count(*key), 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Test index does it insert everything uniquely
|
|
|
|
TEST_F(LabelPropertyIndexComplexTest, UniqueInsert) {
|
|
|
|
index.UpdateOnLabelProperty(vlist, vertex);
|
|
|
|
index.UpdateOnLabelProperty(vlist, vertex);
|
|
|
|
EXPECT_EQ(index.Count(*key), 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Check if index filters duplicates.
|
|
|
|
TEST_F(LabelPropertyIndexComplexTest, UniqueFilter) {
|
|
|
|
index.UpdateOnLabelProperty(vlist, vertex);
|
2017-11-29 23:03:42 +08:00
|
|
|
engine.Commit(*t);
|
LabelProperty index.
Summary:
Add return values.
After merge.
Inital working version. Still missing comments.
Update documentation.
Add checking for previous vlist and value equality.
After merge.
Remove functor, add boolean ffunction.
Build index.
More functionality. Start implementing tests.
Add tests.
Reviewers: matej.gradicek, mislav.bradac, mferencevic, buda, florijan
Reviewed By: mislav.bradac, buda, florijan
Subscribers: lion, florijan, teon.banek, buda, pullbot
Differential Revision: https://phabricator.memgraph.io/D355
2017-05-16 20:47:03 +08:00
|
|
|
|
2017-06-12 16:21:19 +08:00
|
|
|
auto t2 = engine.Begin();
|
LabelProperty index.
Summary:
Add return values.
After merge.
Inital working version. Still missing comments.
Update documentation.
Add checking for previous vlist and value equality.
After merge.
Remove functor, add boolean ffunction.
Build index.
More functionality. Start implementing tests.
Add tests.
Reviewers: matej.gradicek, mislav.bradac, mferencevic, buda, florijan
Reviewed By: mislav.bradac, buda, florijan
Subscribers: lion, florijan, teon.banek, buda, pullbot
Differential Revision: https://phabricator.memgraph.io/D355
2017-05-16 20:47:03 +08:00
|
|
|
auto vertex2 = vlist->update(*t2);
|
2017-11-29 23:03:42 +08:00
|
|
|
engine.Commit(*t2);
|
LabelProperty index.
Summary:
Add return values.
After merge.
Inital working version. Still missing comments.
Update documentation.
Add checking for previous vlist and value equality.
After merge.
Remove functor, add boolean ffunction.
Build index.
More functionality. Start implementing tests.
Add tests.
Reviewers: matej.gradicek, mislav.bradac, mferencevic, buda, florijan
Reviewed By: mislav.bradac, buda, florijan
Subscribers: lion, florijan, teon.banek, buda, pullbot
Differential Revision: https://phabricator.memgraph.io/D355
2017-05-16 20:47:03 +08:00
|
|
|
|
|
|
|
index.UpdateOnLabelProperty(vlist, vertex2);
|
|
|
|
EXPECT_EQ(index.Count(*key), 2);
|
|
|
|
|
2017-06-12 16:21:19 +08:00
|
|
|
auto t3 = engine.Begin();
|
2017-06-07 15:49:51 +08:00
|
|
|
auto iter = index.GetVlists(*key, *t3, false);
|
LabelProperty index.
Summary:
Add return values.
After merge.
Inital working version. Still missing comments.
Update documentation.
Add checking for previous vlist and value equality.
After merge.
Remove functor, add boolean ffunction.
Build index.
More functionality. Start implementing tests.
Add tests.
Reviewers: matej.gradicek, mislav.bradac, mferencevic, buda, florijan
Reviewed By: mislav.bradac, buda, florijan
Subscribers: lion, florijan, teon.banek, buda, pullbot
Differential Revision: https://phabricator.memgraph.io/D355
2017-05-16 20:47:03 +08:00
|
|
|
EXPECT_EQ(std::distance(iter.begin(), iter.end()), 1);
|
2017-11-29 23:03:42 +08:00
|
|
|
engine.Commit(*t3);
|
LabelProperty index.
Summary:
Add return values.
After merge.
Inital working version. Still missing comments.
Update documentation.
Add checking for previous vlist and value equality.
After merge.
Remove functor, add boolean ffunction.
Build index.
More functionality. Start implementing tests.
Add tests.
Reviewers: matej.gradicek, mislav.bradac, mferencevic, buda, florijan
Reviewed By: mislav.bradac, buda, florijan
Subscribers: lion, florijan, teon.banek, buda, pullbot
Differential Revision: https://phabricator.memgraph.io/D355
2017-05-16 20:47:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Remove label and check if index vertex is not returned now.
|
|
|
|
TEST_F(LabelPropertyIndexComplexTest, RemoveLabel) {
|
|
|
|
index.UpdateOnLabelProperty(vlist, vertex);
|
|
|
|
|
2017-06-07 15:49:51 +08:00
|
|
|
auto iter1 = index.GetVlists(*key, *t, false);
|
LabelProperty index.
Summary:
Add return values.
After merge.
Inital working version. Still missing comments.
Update documentation.
Add checking for previous vlist and value equality.
After merge.
Remove functor, add boolean ffunction.
Build index.
More functionality. Start implementing tests.
Add tests.
Reviewers: matej.gradicek, mislav.bradac, mferencevic, buda, florijan
Reviewed By: mislav.bradac, buda, florijan
Subscribers: lion, florijan, teon.banek, buda, pullbot
Differential Revision: https://phabricator.memgraph.io/D355
2017-05-16 20:47:03 +08:00
|
|
|
EXPECT_EQ(std::distance(iter1.begin(), iter1.end()), 1);
|
|
|
|
|
|
|
|
vertex->labels_.clear();
|
2017-06-07 15:49:51 +08:00
|
|
|
auto iter2 = index.GetVlists(*key, *t, false);
|
LabelProperty index.
Summary:
Add return values.
After merge.
Inital working version. Still missing comments.
Update documentation.
Add checking for previous vlist and value equality.
After merge.
Remove functor, add boolean ffunction.
Build index.
More functionality. Start implementing tests.
Add tests.
Reviewers: matej.gradicek, mislav.bradac, mferencevic, buda, florijan
Reviewed By: mislav.bradac, buda, florijan
Subscribers: lion, florijan, teon.banek, buda, pullbot
Differential Revision: https://phabricator.memgraph.io/D355
2017-05-16 20:47:03 +08:00
|
|
|
EXPECT_EQ(std::distance(iter2.begin(), iter2.end()), 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Remove property and check if vertex is not returned now.
|
|
|
|
TEST_F(LabelPropertyIndexComplexTest, RemoveProperty) {
|
|
|
|
index.UpdateOnLabelProperty(vlist, vertex);
|
|
|
|
|
2017-06-07 15:49:51 +08:00
|
|
|
auto iter1 = index.GetVlists(*key, *t, false);
|
LabelProperty index.
Summary:
Add return values.
After merge.
Inital working version. Still missing comments.
Update documentation.
Add checking for previous vlist and value equality.
After merge.
Remove functor, add boolean ffunction.
Build index.
More functionality. Start implementing tests.
Add tests.
Reviewers: matej.gradicek, mislav.bradac, mferencevic, buda, florijan
Reviewed By: mislav.bradac, buda, florijan
Subscribers: lion, florijan, teon.banek, buda, pullbot
Differential Revision: https://phabricator.memgraph.io/D355
2017-05-16 20:47:03 +08:00
|
|
|
EXPECT_EQ(std::distance(iter1.begin(), iter1.end()), 1);
|
|
|
|
|
|
|
|
vertex->properties_.clear();
|
2017-06-07 15:49:51 +08:00
|
|
|
auto iter2 = index.GetVlists(*key, *t, false);
|
LabelProperty index.
Summary:
Add return values.
After merge.
Inital working version. Still missing comments.
Update documentation.
Add checking for previous vlist and value equality.
After merge.
Remove functor, add boolean ffunction.
Build index.
More functionality. Start implementing tests.
Add tests.
Reviewers: matej.gradicek, mislav.bradac, mferencevic, buda, florijan
Reviewed By: mislav.bradac, buda, florijan
Subscribers: lion, florijan, teon.banek, buda, pullbot
Differential Revision: https://phabricator.memgraph.io/D355
2017-05-16 20:47:03 +08:00
|
|
|
EXPECT_EQ(std::distance(iter2.begin(), iter2.end()), 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Refresh with a vertex that looses its labels and properties.
|
|
|
|
TEST_F(LabelPropertyIndexComplexTest, Refresh) {
|
|
|
|
index.UpdateOnLabelProperty(vlist, vertex);
|
2017-11-29 23:03:42 +08:00
|
|
|
engine.Commit(*t);
|
LabelProperty index.
Summary:
Add return values.
After merge.
Inital working version. Still missing comments.
Update documentation.
Add checking for previous vlist and value equality.
After merge.
Remove functor, add boolean ffunction.
Build index.
More functionality. Start implementing tests.
Add tests.
Reviewers: matej.gradicek, mislav.bradac, mferencevic, buda, florijan
Reviewed By: mislav.bradac, buda, florijan
Subscribers: lion, florijan, teon.banek, buda, pullbot
Differential Revision: https://phabricator.memgraph.io/D355
2017-05-16 20:47:03 +08:00
|
|
|
EXPECT_EQ(index.Count(*key), 1);
|
|
|
|
vertex->labels_.clear();
|
|
|
|
vertex->properties_.clear();
|
2017-06-12 16:21:19 +08:00
|
|
|
index.Refresh(GcSnapshot(engine, nullptr), engine);
|
2017-06-07 15:49:51 +08:00
|
|
|
auto iter = index.GetVlists(*key, *t, false);
|
LabelProperty index.
Summary:
Add return values.
After merge.
Inital working version. Still missing comments.
Update documentation.
Add checking for previous vlist and value equality.
After merge.
Remove functor, add boolean ffunction.
Build index.
More functionality. Start implementing tests.
Add tests.
Reviewers: matej.gradicek, mislav.bradac, mferencevic, buda, florijan
Reviewed By: mislav.bradac, buda, florijan
Subscribers: lion, florijan, teon.banek, buda, pullbot
Differential Revision: https://phabricator.memgraph.io/D355
2017-05-16 20:47:03 +08:00
|
|
|
EXPECT_EQ(std::distance(iter.begin(), iter.end()), 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
::testing::InitGoogleTest(&argc, argv);
|
|
|
|
return RUN_ALL_TESTS();
|
|
|
|
}
|