Remove extraneous comments and #includes
This commit is contained in:
parent
0571da7116
commit
e4e3044fce
@ -251,7 +251,6 @@ VertexAccessor &CreateLocalVertex(const NodeCreationInfo &node_info, Frame *fram
|
||||
}
|
||||
MultiPropsInitChecked(&new_node, properties);
|
||||
|
||||
// TODO antepusic check if text search is turned on
|
||||
if (flags::run_time::GetTextSearchEnabled()) {
|
||||
new_node.impl_.storage_->indices_.text_index_->AddNode(new_node.impl_.vertex_, new_node.impl_.storage_);
|
||||
}
|
||||
@ -2824,7 +2823,6 @@ bool SetProperty::SetPropertyCursor::Pull(Frame &frame, ExecutionContext &contex
|
||||
context.trigger_context_collector->RegisterSetObjectProperty(lhs.ValueVertex(), self_.property_,
|
||||
TypedValue{std::move(old_value)}, TypedValue{rhs});
|
||||
}
|
||||
// TODO antepusic: update text index
|
||||
if (flags::run_time::GetTextSearchEnabled()) {
|
||||
auto new_node = lhs.ValueVertex();
|
||||
new_node.impl_.storage_->indices_.text_index_->UpdateNode(new_node.impl_.vertex_, new_node.impl_.storage_);
|
||||
@ -2985,7 +2983,6 @@ void SetPropertiesOnRecord(TRecordAccessor *record, const TypedValue &rhs, SetPr
|
||||
case TypedValue::Type::Vertex: {
|
||||
PropertiesMap new_properties = get_props(rhs.ValueVertex());
|
||||
update_props(new_properties);
|
||||
// TODO antepusic: update text index
|
||||
if (flags::run_time::GetTextSearchEnabled()) {
|
||||
auto new_node = rhs.ValueVertex();
|
||||
new_node.impl_.storage_->indices_.text_index_->UpdateNode(new_node.impl_.vertex_, new_node.impl_.storage_);
|
||||
@ -3136,7 +3133,6 @@ bool SetLabels::SetLabelsCursor::Pull(Frame &frame, ExecutionContext &context) {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO antepusic check if text search is turned on
|
||||
if (flags::run_time::GetTextSearchEnabled()) {
|
||||
vertex.impl_.storage_->indices_.text_index_->UpdateNode(vertex.impl_.vertex_, vertex.impl_.storage_);
|
||||
}
|
||||
@ -3302,7 +3298,6 @@ bool RemoveLabels::RemoveLabelsCursor::Pull(Frame &frame, ExecutionContext &cont
|
||||
}
|
||||
}
|
||||
|
||||
// TODO antepusic check if text search is turned on
|
||||
if (flags::run_time::GetTextSearchEnabled()) {
|
||||
vertex.impl_.storage_->indices_.text_index_->UpdateNode(vertex.impl_.vertex_, vertex.impl_.storage_, self_.labels_);
|
||||
}
|
||||
|
@ -38,21 +38,6 @@ void Indices::RemoveObsoleteEntries(uint64_t oldest_active_start_timestamp) cons
|
||||
->RemoveObsoleteEntries(oldest_active_start_timestamp);
|
||||
}
|
||||
|
||||
// void Indices::UpdateOnAddLabel(LabelId label, Vertex *vertex, const Transaction &tx) const {
|
||||
// label_index_->UpdateOnAddLabel(label, vertex, tx);
|
||||
// label_property_index_->UpdateOnAddLabel(label, vertex, tx);
|
||||
// }
|
||||
|
||||
// void Indices::UpdateOnRemoveLabel(LabelId label, Vertex *vertex, const Transaction &tx) const {
|
||||
// label_index_->UpdateOnRemoveLabel(label, vertex, tx);
|
||||
// label_property_index_->UpdateOnRemoveLabel(label, vertex, tx);
|
||||
// }
|
||||
|
||||
// void Indices::UpdateOnSetProperty(PropertyId property, const PropertyValue &value, Vertex *vertex,
|
||||
// const Transaction &tx) const {
|
||||
// label_property_index_->UpdateOnSetProperty(property, value, vertex, tx);
|
||||
// }
|
||||
|
||||
void Indices::UpdateOnAddLabel(LabelId label, Vertex *vertex, const Transaction &tx, Storage *storage,
|
||||
bool update_text_index) const {
|
||||
label_index_->UpdateOnAddLabel(label, vertex, tx);
|
||||
|
@ -56,17 +56,13 @@ struct Indices {
|
||||
|
||||
/// This function should be called whenever a label is added to a vertex.
|
||||
/// @throw std::bad_alloc
|
||||
// void UpdateOnAddLabel(LabelId label, Vertex *vertex, const Transaction &tx) const;
|
||||
void UpdateOnAddLabel(LabelId label, Vertex *vertex, const Transaction &tx, Storage *storage,
|
||||
bool update_text_index) const;
|
||||
|
||||
// void UpdateOnRemoveLabel(LabelId label, Vertex *vertex, const Transaction &tx) const;
|
||||
void UpdateOnRemoveLabel(LabelId label, Vertex *vertex, const Transaction &tx, bool update_text_index) const;
|
||||
|
||||
/// This function should be called whenever a property is modified on a vertex.
|
||||
/// @throw std::bad_alloc
|
||||
// void UpdateOnSetProperty(PropertyId property, const PropertyValue &value, Vertex *vertex,
|
||||
// const Transaction &tx) const;
|
||||
void UpdateOnSetProperty(PropertyId property, const PropertyValue &value, Vertex *vertex, const Transaction &tx,
|
||||
Storage *storage, bool update_text_index) const;
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
#include "storage/v2/indices/text_index.hpp"
|
||||
#include "query/db_accessor.hpp"
|
||||
#include "storage/v2/mgcxx_mock.hpp"
|
||||
#include "storage/v2/view.hpp"
|
||||
#include "text_search.hpp"
|
||||
|
||||
|
@ -12,7 +12,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "storage/v2/id_types.hpp"
|
||||
#include "storage/v2/mgcxx_mock.hpp"
|
||||
#include "storage/v2/transaction.hpp"
|
||||
#include "storage/v2/vertex.hpp"
|
||||
#include "text_search.hpp"
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "storage/v2/mgcxx_mock.hpp"
|
||||
#include "storage/v2/temporal.hpp"
|
||||
#include "utils/cast.hpp"
|
||||
#include "utils/logging.hpp"
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <json/json.hpp>
|
||||
#include <map>
|
||||
#include <set>
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "absl/container/flat_hash_set.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
#include "flags/run_time_configurable.hpp"
|
||||
#include "storage/v2/disk/name_id_mapper.hpp"
|
||||
#include "storage/v2/storage.hpp"
|
||||
#include "storage/v2/transaction.hpp"
|
||||
@ -147,8 +148,9 @@ Result<std::optional<VertexAccessor>> Storage::Accessor::DeleteVertex(VertexAcce
|
||||
return res.GetError();
|
||||
}
|
||||
|
||||
// TODO antepusic remove from text index
|
||||
vertex->storage_->indices_.text_index_->RemoveNode(vertex->vertex_);
|
||||
if (flags::run_time::GetTextSearchEnabled()) {
|
||||
vertex->storage_->indices_.text_index_->RemoveNode(vertex->vertex_);
|
||||
}
|
||||
|
||||
const auto &value = res.GetValue();
|
||||
if (!value) {
|
||||
@ -187,8 +189,9 @@ Result<std::optional<std::pair<VertexAccessor, std::vector<EdgeAccessor>>>> Stor
|
||||
return res.GetError();
|
||||
}
|
||||
|
||||
// TODO antepusic remove from text index
|
||||
vertex->storage_->indices_.text_index_->RemoveNode(vertex->vertex_);
|
||||
if (flags::run_time::GetTextSearchEnabled()) {
|
||||
vertex->storage_->indices_.text_index_->RemoveNode(vertex->vertex_);
|
||||
}
|
||||
|
||||
auto &value = res.GetValue();
|
||||
if (!value) {
|
||||
@ -278,9 +281,10 @@ Storage::Accessor::DetachDelete(std::vector<VertexAccessor *> nodes, std::vector
|
||||
return maybe_deleted_vertices.GetError();
|
||||
}
|
||||
|
||||
// TODO antepusic delete from text index here
|
||||
for (auto node : nodes_to_delete) {
|
||||
storage_->indices_.text_index_->RemoveNode(node);
|
||||
if (flags::run_time::GetTextSearchEnabled()) {
|
||||
for (auto *node : nodes_to_delete) {
|
||||
storage_->indices_.text_index_->RemoveNode(node);
|
||||
}
|
||||
}
|
||||
|
||||
auto deleted_vertices = maybe_deleted_vertices.GetValue();
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include "storage/v2/durability/wal.hpp"
|
||||
#include "storage/v2/edge_accessor.hpp"
|
||||
#include "storage/v2/indices/indices.hpp"
|
||||
#include "storage/v2/mgcxx_mock.hpp"
|
||||
#include "storage/v2/mvcc.hpp"
|
||||
#include "storage/v2/replication/enums.hpp"
|
||||
#include "storage/v2/replication/replication_client.hpp"
|
||||
|
@ -17,13 +17,11 @@
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include "flags/run_time_configurable.hpp"
|
||||
#include "query/exceptions.hpp"
|
||||
#include "storage/v2/disk/storage.hpp"
|
||||
#include "storage/v2/edge_accessor.hpp"
|
||||
#include "storage/v2/id_types.hpp"
|
||||
#include "storage/v2/indices/indices.hpp"
|
||||
#include "storage/v2/mgcxx_mock.hpp"
|
||||
#include "storage/v2/mvcc.hpp"
|
||||
#include "storage/v2/property_value.hpp"
|
||||
#include "storage/v2/result.hpp"
|
||||
@ -290,20 +288,6 @@ Result<PropertyValue> VertexAccessor::SetProperty(PropertyId property, const Pro
|
||||
storage_->indices_.UpdateOnSetProperty(property, value, vertex_, *transaction_, storage_, update_text_index);
|
||||
transaction_->manyDeltasCache.Invalidate(vertex_, property);
|
||||
|
||||
// if (flags::run_time::GetTextSearchEnabled() && update_text_index) {
|
||||
// for (auto *index_context : storage_->indices_.text_index_->GetApplicableTextIndices(vertex_)) {
|
||||
// auto search_input = mgcxx::text_search::SearchInput{
|
||||
// .search_query = fmt::format("metadata.gid:{}", vertex_->gid.AsInt()), .return_fields = {"data"}};
|
||||
|
||||
// auto search_result = mgcxx::text_search::search(*index_context, search_input);
|
||||
// mgcxx::text_search::delete_document(*index_context, search_input, true);
|
||||
// auto new_properties = search_result.docs[0].data; // TODO (pending real Tantivy results): parse result to
|
||||
// // JSON, set property and convert back to string
|
||||
// auto new_properties_document = mgcxx::text_search::DocumentInput{.data = new_properties};
|
||||
// mgcxx::text_search::add_document(*index_context, new_properties_document, true);
|
||||
// }
|
||||
// }
|
||||
|
||||
return std::move(current_value);
|
||||
}
|
||||
|
||||
@ -340,15 +324,6 @@ Result<bool> VertexAccessor::InitProperties(const std::map<storage::PropertyId,
|
||||
}};
|
||||
std::invoke(atomic_memory_block);
|
||||
|
||||
// if (flags::run_time::GetTextSearchEnabled() && update_text_index) {
|
||||
// for (auto *index_context : storage_->indices_.text_index_->GetApplicableTextIndices(vertex_)) {
|
||||
// auto new_properties_document =
|
||||
// mgcxx::text_search::DocumentInput{}; // TODO (pending real Tantivy operation): create a JSON, set
|
||||
// // properties and convert to string
|
||||
// mgcxx::text_search::add_document(*index_context, new_properties_document, true);
|
||||
// }
|
||||
// }
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -370,19 +345,6 @@ Result<std::vector<std::tuple<PropertyId, PropertyValue, PropertyValue>>> Vertex
|
||||
utils::AtomicMemoryBlock atomic_memory_block{[storage = storage_, transaction = transaction_, vertex = vertex_,
|
||||
&properties, &id_old_new_change, update_text_index]() {
|
||||
id_old_new_change.emplace(vertex->properties.UpdateProperties(properties));
|
||||
// if (flags::run_time::GetTextSearchEnabled()) {
|
||||
// for (auto *index_context : storage->indices_.text_index_->GetApplicableTextIndices(vertex)) {
|
||||
// auto search_input = mgcxx::text_search::SearchInput{
|
||||
// .search_query = fmt::format("metadata.gid:{}", vertex->gid.AsInt()), .return_fields = {"data"}};
|
||||
|
||||
// auto search_result = mgcxx::text_search::search(*index_context, search_input);
|
||||
// mgcxx::text_search::delete_document(*index_context, search_input, true);
|
||||
// auto new_properties = search_result.docs[0].data; // TODO (pending real Tantivy results): parse result to
|
||||
// // JSON, set property and convert back to string
|
||||
// auto new_properties_document = mgcxx::text_search::DocumentInput{.data = new_properties};
|
||||
// mgcxx::text_search::add_document(*index_context, new_properties_document, true);
|
||||
// }
|
||||
// }
|
||||
|
||||
if (!id_old_new_change.has_value()) {
|
||||
return;
|
||||
@ -430,14 +392,6 @@ Result<std::map<PropertyId, PropertyValue>> VertexAccessor::ClearProperties(bool
|
||||
}
|
||||
|
||||
vertex->properties.ClearProperties();
|
||||
// if (flags::run_time::GetTextSearchEnabled()) {
|
||||
// for (auto *index_context : storage->indices_.text_index_->GetApplicableTextIndices(vertex)) {
|
||||
// auto search_input =
|
||||
// mgcxx::text_search::SearchInput{.search_query = fmt::format("metadata.gid:{}",
|
||||
// vertex->gid.AsInt())};
|
||||
// mgcxx::text_search::delete_document(*index_context, search_input, true);
|
||||
// }
|
||||
// }
|
||||
}};
|
||||
std::invoke(atomic_memory_block);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user