Added edge type indices to be cleaned up inside drop graph
This commit is contained in:
parent
84df6dcd02
commit
e99c7dd45b
@ -46,4 +46,8 @@ void DiskEdgeTypeIndex::UpdateOnEdgeModification(Vertex * /*old_from*/, Vertex *
|
||||
spdlog::warn("Edge-type index related operations are not yet supported using on-disk storage mode.");
|
||||
}
|
||||
|
||||
void DiskEdgeTypeIndex::DropGraphClearIndices() {
|
||||
spdlog::warn("Edge-type index related operations are not yet supported using on-disk storage mode.");
|
||||
}
|
||||
|
||||
} // namespace memgraph::storage
|
||||
|
@ -30,6 +30,8 @@ class DiskEdgeTypeIndex : public storage::EdgeTypeIndex {
|
||||
|
||||
void UpdateOnEdgeModification(Vertex *old_from, Vertex *old_to, Vertex *new_from, Vertex *new_to, EdgeRef edge_ref,
|
||||
EdgeTypeId edge_type, const Transaction &tx) override;
|
||||
|
||||
void DropGraphClearIndices() override;
|
||||
};
|
||||
|
||||
} // namespace memgraph::storage
|
||||
|
@ -41,6 +41,8 @@ class EdgeTypeIndex {
|
||||
|
||||
virtual void UpdateOnEdgeModification(Vertex *old_from, Vertex *old_to, Vertex *new_from, Vertex *new_to,
|
||||
EdgeRef edge_ref, EdgeTypeId edge_type, const Transaction &tx) = 0;
|
||||
|
||||
virtual void DropGraphClearIndices() = 0;
|
||||
};
|
||||
|
||||
} // namespace memgraph::storage
|
||||
|
@ -45,6 +45,7 @@ void Indices::RemoveObsoleteEntries(uint64_t oldest_active_start_timestamp, std:
|
||||
void Indices::DropGraphClearIndices() const {
|
||||
static_cast<InMemoryLabelIndex *>(label_index_.get())->DropGraphClearIndices();
|
||||
static_cast<InMemoryLabelPropertyIndex *>(label_property_index_.get())->DropGraphClearIndices();
|
||||
static_cast<InMemoryEdgeTypeIndex *>(edge_type_index_.get())->DropGraphClearIndices();
|
||||
}
|
||||
|
||||
void Indices::UpdateOnAddLabel(LabelId label, Vertex *vertex, const Transaction &tx) const {
|
||||
|
@ -215,6 +215,8 @@ void InMemoryEdgeTypeIndex::UpdateOnEdgeModification(Vertex *old_from, Vertex *o
|
||||
acc.insert(Entry{new_from, new_to, edge_ref.ptr, tx.start_timestamp});
|
||||
}
|
||||
|
||||
void InMemoryEdgeTypeIndex::DropGraphClearIndices() { index_.clear(); }
|
||||
|
||||
InMemoryEdgeTypeIndex::Iterable::Iterable(utils::SkipList<Entry>::Accessor index_accessor, EdgeTypeId edge_type,
|
||||
View view, Storage *storage, Transaction *transaction)
|
||||
: index_accessor_(std::move(index_accessor)),
|
||||
|
@ -61,6 +61,8 @@ class InMemoryEdgeTypeIndex : public storage::EdgeTypeIndex {
|
||||
void UpdateOnEdgeModification(Vertex *old_from, Vertex *old_to, Vertex *new_from, Vertex *new_to, EdgeRef edge_ref,
|
||||
EdgeTypeId edge_type, const Transaction &tx) override;
|
||||
|
||||
void DropGraphClearIndices() override;
|
||||
|
||||
static constexpr std::size_t kEdgeTypeIdPos = 0U;
|
||||
static constexpr std::size_t kVertexPos = 1U;
|
||||
static constexpr std::size_t kEdgeRefPos = 2U;
|
||||
|
@ -237,9 +237,6 @@ std::vector<LabelId> InMemoryLabelIndex::Analysis() const {
|
||||
}
|
||||
|
||||
void InMemoryLabelIndex::DropGraphClearIndices() {
|
||||
for (auto &[label, storage] : index_) {
|
||||
storage.clear();
|
||||
}
|
||||
index_.clear();
|
||||
stats_->clear();
|
||||
}
|
||||
|
@ -500,9 +500,6 @@ void InMemoryLabelPropertyIndex::AbortEntries(LabelId label,
|
||||
}
|
||||
|
||||
void InMemoryLabelPropertyIndex::DropGraphClearIndices() {
|
||||
for (auto &[label_prop, storage] : index_) {
|
||||
storage.clear();
|
||||
}
|
||||
index_.clear();
|
||||
indices_by_property_.clear();
|
||||
stats_->clear();
|
||||
|
@ -525,9 +525,6 @@ void InMemoryUniqueConstraints::Clear() {
|
||||
bool InMemoryUniqueConstraints::empty() const { return constraints_.empty() && constraints_by_label_.empty(); }
|
||||
|
||||
void InMemoryUniqueConstraints::DropGraphClearConstraints() {
|
||||
for (auto &[label_props, storage] : constraints_) {
|
||||
storage.clear();
|
||||
};
|
||||
constraints_.clear();
|
||||
constraints_by_label_.clear();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user