-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update graph info in the augmented block metadata (#1642)
An update can invalidate a cached query result in the sense that if one would run the query again after the update, the result may be different. This was ignored so far, and is now considered as follows: Each `LocatedTriplesSnapshot` gets its own "index" (starting from zero and then incremented for each new snaphot). That index becomes part of the cache key. That way, a query will make use of a cached result if and only if there was no update between the time of the query and the time when the cached result was computed.
- Loading branch information
Showing
5 changed files
with
220 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// Chair of Algorithms and Data Structures | ||
// Author: Hannes Baumann <[email protected]> | ||
|
||
#include <gtest/gtest.h> | ||
#include <gmock/gmock.h> | ||
|
||
#include <vector> | ||
|
||
|
@@ -157,18 +157,32 @@ class PrefilterExpressionOnMetadataTest : public ::testing::Test { | |
|
||
//______________________________________________________________________________ | ||
TEST_F(PrefilterExpressionOnMetadataTest, testBlockFormatForDebugging) { | ||
EXPECT_EQ( | ||
"#BlockMetadata\n(first) Triple: I:0 V:10 D:33.000000 V:0\n(last) " | ||
"Triple: I:0 V:10 D:33.000000 V:0\nnum. rows: 0.\n", | ||
(std::stringstream() << b5).str()); | ||
EXPECT_EQ( | ||
"#BlockMetadata\n(first) Triple: I:-4 V:10 D:33.000000 V:0\n(last) " | ||
"Triple: D:2.000000 V:10 D:33.000000 V:0\nnum. rows: 0.\n", | ||
(std::stringstream() << b11).str()); | ||
EXPECT_EQ( | ||
"#BlockMetadata\n(first) Triple: V:14 V:10 D:33.000000 V:0\n(last) " | ||
"Triple: V:17 V:10 D:33.000000 V:0\nnum. rows: 0.\n", | ||
(std::stringstream() << b21).str()); | ||
auto toString = [](const CompressedBlockMetadata& b) { | ||
return (std::stringstream{} << b).str(); | ||
}; | ||
|
||
auto matcher = [&toString](const std::string& substring) { | ||
return ::testing::ResultOf(toString, ::testing::HasSubstr(substring)); | ||
}; | ||
EXPECT_THAT( | ||
b5, | ||
matcher( | ||
"#BlockMetadata\n(first) Triple: I:0 V:10 D:33.000000 V:0\n(last) " | ||
"Triple: I:0 V:10 D:33.000000 V:0\nnum. rows: 0.\n")); | ||
EXPECT_THAT( | ||
b11, | ||
matcher( | ||
"#BlockMetadata\n(first) Triple: I:-4 V:10 D:33.000000 V:0\n(last) " | ||
"Triple: D:2.000000 V:10 D:33.000000 V:0\nnum. rows: 0.\n")); | ||
EXPECT_THAT( | ||
b21, | ||
matcher( | ||
"#BlockMetadata\n(first) Triple: V:14 V:10 D:33.000000 V:0\n(last) " | ||
"Triple: V:17 V:10 D:33.000000 V:0\nnum. rows: 0.\n")); | ||
|
||
auto blockWithGraphInfo = b21; | ||
blockWithGraphInfo.graphInfo_.emplace({IntId(12), IntId(13)}); | ||
EXPECT_THAT(blockWithGraphInfo, matcher("Graphs: I:12, I:13\n")); | ||
} | ||
|
||
// Test Relational Expressions | ||
|