React to PR comments
This commit is contained in:
parent
8aed5821f2
commit
d5f717d030
@ -206,7 +206,12 @@ void InMemoryEdgeTypeIndex::UpdateOnEdgeModification(Vertex *old_from, Vertex *o
|
|||||||
}
|
}
|
||||||
auto acc = it->second.access();
|
auto acc = it->second.access();
|
||||||
|
|
||||||
acc.remove(Entry{old_from, old_to, edge_ref.ptr, tx.start_timestamp});
|
auto entry_to_update = std::ranges::find_if(acc, [&](const auto &entry) {
|
||||||
|
return entry.from_vertex == old_from && entry.to_vertex == old_to && entry.edge == edge_ref.ptr;
|
||||||
|
});
|
||||||
|
|
||||||
|
acc.remove(Entry{entry_to_update->from_vertex, entry_to_update->to_vertex, entry_to_update->edge,
|
||||||
|
entry_to_update->timestamp});
|
||||||
acc.insert(Entry{new_from, new_to, edge_ref.ptr, tx.start_timestamp});
|
acc.insert(Entry{new_from, new_to, edge_ref.ptr, tx.start_timestamp});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -557,12 +557,10 @@ Result<EdgeAccessor> InMemoryStorage::InMemoryAccessor::EdgeSetFrom(EdgeAccessor
|
|||||||
CreateAndLinkDelta(&transaction_, to_vertex, Delta::RemoveInEdgeTag(), edge_type, new_from_vertex, edge_ref);
|
CreateAndLinkDelta(&transaction_, to_vertex, Delta::RemoveInEdgeTag(), edge_type, new_from_vertex, edge_ref);
|
||||||
to_vertex->in_edges.emplace_back(edge_type, new_from_vertex, edge_ref);
|
to_vertex->in_edges.emplace_back(edge_type, new_from_vertex, edge_ref);
|
||||||
|
|
||||||
if (storage_->storage_mode_ != StorageMode::ON_DISK_TRANSACTIONAL) {
|
auto *in_memory = static_cast<InMemoryStorage *>(storage_);
|
||||||
auto *in_memory = static_cast<InMemoryStorage *>(storage_);
|
auto *mem_edge_type_index = static_cast<InMemoryEdgeTypeIndex *>(in_memory->indices_.edge_type_index_.get());
|
||||||
auto *mem_edge_type_index = static_cast<InMemoryEdgeTypeIndex *>(in_memory->indices_.edge_type_index_.get());
|
mem_edge_type_index->UpdateOnEdgeModification(old_from_vertex, to_vertex, new_from_vertex, to_vertex, edge_ref,
|
||||||
mem_edge_type_index->UpdateOnEdgeModification(old_from_vertex, to_vertex, new_from_vertex, to_vertex,
|
edge_type, transaction_);
|
||||||
edge_ref, edge_type, transaction_);
|
|
||||||
}
|
|
||||||
|
|
||||||
transaction_.manyDeltasCache.Invalidate(new_from_vertex, edge_type, EdgeDirection::OUT);
|
transaction_.manyDeltasCache.Invalidate(new_from_vertex, edge_type, EdgeDirection::OUT);
|
||||||
transaction_.manyDeltasCache.Invalidate(old_from_vertex, edge_type, EdgeDirection::OUT);
|
transaction_.manyDeltasCache.Invalidate(old_from_vertex, edge_type, EdgeDirection::OUT);
|
||||||
@ -670,12 +668,10 @@ Result<EdgeAccessor> InMemoryStorage::InMemoryAccessor::EdgeSetTo(EdgeAccessor *
|
|||||||
CreateAndLinkDelta(&transaction_, new_to_vertex, Delta::RemoveInEdgeTag(), edge_type, from_vertex, edge_ref);
|
CreateAndLinkDelta(&transaction_, new_to_vertex, Delta::RemoveInEdgeTag(), edge_type, from_vertex, edge_ref);
|
||||||
new_to_vertex->in_edges.emplace_back(edge_type, from_vertex, edge_ref);
|
new_to_vertex->in_edges.emplace_back(edge_type, from_vertex, edge_ref);
|
||||||
|
|
||||||
if (storage_->storage_mode_ != StorageMode::ON_DISK_TRANSACTIONAL) {
|
auto *in_memory = static_cast<InMemoryStorage *>(storage_);
|
||||||
auto *in_memory = static_cast<InMemoryStorage *>(storage_);
|
auto *mem_edge_type_index = static_cast<InMemoryEdgeTypeIndex *>(in_memory->indices_.edge_type_index_.get());
|
||||||
auto *mem_edge_type_index = static_cast<InMemoryEdgeTypeIndex *>(in_memory->indices_.edge_type_index_.get());
|
mem_edge_type_index->UpdateOnEdgeModification(from_vertex, old_to_vertex, from_vertex, new_to_vertex, edge_ref,
|
||||||
mem_edge_type_index->UpdateOnEdgeModification(from_vertex, old_to_vertex, from_vertex, new_to_vertex,
|
edge_type, transaction_);
|
||||||
edge_ref, edge_type, transaction_);
|
|
||||||
}
|
|
||||||
|
|
||||||
transaction_.manyDeltasCache.Invalidate(from_vertex, edge_type, EdgeDirection::OUT);
|
transaction_.manyDeltasCache.Invalidate(from_vertex, edge_type, EdgeDirection::OUT);
|
||||||
transaction_.manyDeltasCache.Invalidate(old_to_vertex, edge_type, EdgeDirection::IN);
|
transaction_.manyDeltasCache.Invalidate(old_to_vertex, edge_type, EdgeDirection::IN);
|
||||||
|
Loading…
Reference in New Issue
Block a user