Skip to content

Commit

Permalink
Better naming of version map LoadType and LoadObjective enum values
Browse files Browse the repository at this point in the history
This commit is just a rename addressing some code review comments.
  • Loading branch information
IvoDD committed Jul 23, 2024
1 parent fd7cd1c commit 8f59430
Show file tree
Hide file tree
Showing 13 changed files with 203 additions and 203 deletions.
6 changes: 3 additions & 3 deletions cpp/arcticdb/version/local_versioned_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -864,9 +864,9 @@ folly::Future<folly::Unit> delete_trees_responsibly(
{
auto min_versions = min_versions_for_each_stream(orig_keys_to_delete);
for (const auto& min : min_versions) {
auto load_strategy = load_type == LoadType::LOAD_DOWNTO
? LoadStrategy{load_type, LoadObjective::ANY, static_cast<SignedVersionId>(min.second)}
: LoadStrategy{load_type, LoadObjective::ANY};
auto load_strategy = load_type == LoadType::DOWNTO
? LoadStrategy{load_type, LoadObjective::INCLUDE_DELETED, static_cast<SignedVersionId>(min.second)}
: LoadStrategy{load_type, LoadObjective::INCLUDE_DELETED};
const auto entry = version_map->check_reload(store, min.first, load_strategy, __FUNCTION__);
entry_map.try_emplace(std::move(min.first), entry);
}
Expand Down
28 changes: 14 additions & 14 deletions cpp/arcticdb/version/test/test_stream_version_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ TEST(StreamVersionData, SpecificVersion) {
VersionQuery query_2{SpecificVersionQuery{VersionId(4)}};
stream_version_data.react(query_2);
ASSERT_EQ(stream_version_data.count_, 2);
ASSERT_EQ(stream_version_data.load_strategy_.load_type_, LoadType::LOAD_DOWNTO);
ASSERT_EQ(stream_version_data.load_strategy_.load_objective_, LoadObjective::UNDELETED);
ASSERT_EQ(stream_version_data.load_strategy_.load_type_, LoadType::DOWNTO);
ASSERT_EQ(stream_version_data.load_strategy_.load_objective_, LoadObjective::UNDELETED_ONLY);
ASSERT_EQ(stream_version_data.load_strategy_.load_until_version_, 4);
}

Expand All @@ -25,8 +25,8 @@ TEST(StreamVersionData, SpecificVersionReversed) {
VersionQuery query_2{SpecificVersionQuery{VersionId(12)}};
stream_version_data.react(query_2);
ASSERT_EQ(stream_version_data.count_, 2);
ASSERT_EQ(stream_version_data.load_strategy_.load_type_, LoadType::LOAD_DOWNTO);
ASSERT_EQ(stream_version_data.load_strategy_.load_objective_, LoadObjective::UNDELETED);
ASSERT_EQ(stream_version_data.load_strategy_.load_type_, LoadType::DOWNTO);
ASSERT_EQ(stream_version_data.load_strategy_.load_objective_, LoadObjective::UNDELETED_ONLY);
ASSERT_EQ(stream_version_data.load_strategy_.load_until_version_, 4);
}

Expand All @@ -40,8 +40,8 @@ TEST(StreamVersionData, Timestamp) {
VersionQuery query_2{TimestampVersionQuery{timestamp(4)}};
stream_version_data.react(query_2);
ASSERT_EQ(stream_version_data.count_, 2);
ASSERT_EQ(stream_version_data.load_strategy_.load_type_, LoadType::LOAD_FROM_TIME);
ASSERT_EQ(stream_version_data.load_strategy_.load_objective_, LoadObjective::UNDELETED);
ASSERT_EQ(stream_version_data.load_strategy_.load_type_, LoadType::FROM_TIME);
ASSERT_EQ(stream_version_data.load_strategy_.load_objective_, LoadObjective::UNDELETED_ONLY);
ASSERT_EQ(stream_version_data.load_strategy_.load_from_time_, 4);
}

Expand All @@ -57,8 +57,8 @@ TEST(StreamVersionData, TimestampUnordered) {
VersionQuery query_3{TimestampVersionQuery{timestamp(4)}};
stream_version_data.react(query_3);
ASSERT_EQ(stream_version_data.count_, 3);
ASSERT_EQ(stream_version_data.load_strategy_.load_type_, LoadType::LOAD_FROM_TIME);
ASSERT_EQ(stream_version_data.load_strategy_.load_objective_, LoadObjective::UNDELETED);
ASSERT_EQ(stream_version_data.load_strategy_.load_type_, LoadType::FROM_TIME);
ASSERT_EQ(stream_version_data.load_strategy_.load_objective_, LoadObjective::UNDELETED_ONLY);
ASSERT_EQ(stream_version_data.load_strategy_.load_from_time_, 3);
}

Expand All @@ -70,8 +70,8 @@ TEST(StreamVersionData, Latest) {
VersionQuery query_1{std::monostate{}};
stream_version_data.react(query_1);
ASSERT_EQ(stream_version_data.count_, 1);
ASSERT_EQ(stream_version_data.load_strategy_.load_type_, LoadType::LOAD_LATEST);
ASSERT_EQ(stream_version_data.load_strategy_.load_objective_, LoadObjective::UNDELETED);
ASSERT_EQ(stream_version_data.load_strategy_.load_type_, LoadType::LATEST);
ASSERT_EQ(stream_version_data.load_strategy_.load_objective_, LoadObjective::UNDELETED_ONLY);
ASSERT_EQ(stream_version_data.load_strategy_.load_until_version_.has_value(), false);
}

Expand All @@ -85,8 +85,8 @@ TEST(StreamVersionData, SpecificToTimestamp) {
VersionQuery query_2{TimestampVersionQuery{timestamp(3)}};
stream_version_data.react(query_2);
ASSERT_EQ(stream_version_data.count_, 2);
ASSERT_EQ(stream_version_data.load_strategy_.load_type_, LoadType::LOAD_ALL);
ASSERT_EQ(stream_version_data.load_strategy_.load_objective_, LoadObjective::UNDELETED);
ASSERT_EQ(stream_version_data.load_strategy_.load_type_, LoadType::ALL);
ASSERT_EQ(stream_version_data.load_strategy_.load_objective_, LoadObjective::UNDELETED_ONLY);
ASSERT_EQ(stream_version_data.load_strategy_.load_until_version_.has_value(), false);
ASSERT_EQ(stream_version_data.load_strategy_.load_from_time_.has_value(), false);
}
Expand All @@ -101,8 +101,8 @@ TEST(StreamVersionData, TimestampToSpecific) {
VersionQuery query_2{SpecificVersionQuery{VersionId(12)}};
stream_version_data.react(query_2);
ASSERT_EQ(stream_version_data.count_, 2);
ASSERT_EQ(stream_version_data.load_strategy_.load_type_, LoadType::LOAD_ALL);
ASSERT_EQ(stream_version_data.load_strategy_.load_objective_, LoadObjective::UNDELETED);
ASSERT_EQ(stream_version_data.load_strategy_.load_type_, LoadType::ALL);
ASSERT_EQ(stream_version_data.load_strategy_.load_objective_, LoadObjective::UNDELETED_ONLY);
ASSERT_EQ(stream_version_data.load_strategy_.load_until_version_.has_value(), false);
ASSERT_EQ(stream_version_data.load_strategy_.load_from_time_.has_value(), false);
}
Loading

0 comments on commit 8f59430

Please sign in to comment.