From bab5e1386a51c19352e8c4b82b782a0c41ea4779 Mon Sep 17 00:00:00 2001 From: jbajic Date: Fri, 4 Nov 2022 15:05:55 +0100 Subject: [PATCH] Address review comments --- src/storage/v3/shard_rsm.cpp | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/src/storage/v3/shard_rsm.cpp b/src/storage/v3/shard_rsm.cpp index 2e854e659..77f77f2e7 100644 --- a/src/storage/v3/shard_rsm.cpp +++ b/src/storage/v3/shard_rsm.cpp @@ -180,8 +180,8 @@ std::vector EvaluateVertexExpressions(DbAccessor &dba, const VertexA struct LocalError {}; -std::optional FillUpSourceVertex(const std::optional &v_acc, - const msgs::ExpandOneRequest &req) { +std::optional FillUpSourceVertexSecondaryLabels(const std::optional &v_acc, + const msgs::ExpandOneRequest &req) { auto secondary_labels = v_acc->Labels(View::NEW); if (secondary_labels.HasError()) { spdlog::debug("Encountered an error while trying to get the secondary labels of a vertex. Transaction id: {}", @@ -191,19 +191,6 @@ std::optional FillUpSourceVertex(const std::optionalPrimaryLabel(View::NEW); - if (vertex_label.HasError()) { - spdlog::debug("Encountered an error while trying to get the primary label of source vertex. Transaction id: {}", - req.transaction_id.logical_id); - return std::nullopt; - } - const auto vertex_pk = v_acc->PrimaryKey(View::NEW); - if (vertex_pk.HasError()) { - spdlog::debug("Encountered an error while trying to get the primary key of source vertex. Transaction id: {}", - req.transaction_id.logical_id); - return std::nullopt; - } - source_vertex.id = msgs::VertexId{msgs::Label{*vertex_label}, conversions::ConvertValueVector(*vertex_pk)}; source_vertex.labels.reserve(sec_labels.size()); std::transform(sec_labels.begin(), sec_labels.end(), std::back_inserter(source_vertex.labels), @@ -334,13 +321,14 @@ std::optional GetExpandOneResult( const EdgeUniqunessFunction &maybe_filter_based_on_edge_uniquness, const EdgeFiller &edge_filler, const Schemas::Schema *schema) { /// Fill up source vertex - const auto primary_key = ConvertPropertyVector(std::move(src_vertex.second)); + const auto primary_key = ConvertPropertyVector(src_vertex.second); auto v_acc = acc.FindVertex(primary_key, View::NEW); - auto source_vertex = FillUpSourceVertex(v_acc, req); + auto source_vertex = FillUpSourceVertexSecondaryLabels(v_acc, req); if (!source_vertex) { return std::nullopt; } + source_vertex->id = src_vertex; std::optional> src_vertex_properties; src_vertex_properties = FillUpSourceVertexProperties(v_acc, req, storage::v3::View::NEW, schema);