Remove unnecessary metadata placeholder
This commit is contained in:
@@ -587,8 +587,8 @@ VerticesIterable DiskStorage::DiskAccessor::Vertices(LabelId label, View view) {
|
||||
std::list<storage::Delta> *index_deltas{nullptr};
|
||||
|
||||
auto merge_with_main_cache = [&](auto &index) -> std::unordered_set<Gid> {
|
||||
index[cache_key] = VerticesWithFlag();
|
||||
indexed_vertices = &index[cache_key].vertices;
|
||||
index[cache_key] = utils::SkipList<Vertex>();
|
||||
indexed_vertices = &index[cache_key];
|
||||
index_deltas_storage_.emplace_back();
|
||||
index_deltas = &index_deltas_storage_.back();
|
||||
|
||||
@@ -640,8 +640,8 @@ VerticesIterable DiskStorage::DiskAccessor::Vertices(LabelId label, PropertyId p
|
||||
std::list<storage::Delta> *index_deltas{nullptr};
|
||||
|
||||
auto merge_with_main_cache = [&](auto &index) -> std::unordered_set<Gid> {
|
||||
index[cache_key] = VerticesWithFlag();
|
||||
indexed_vertices = &index[cache_key].vertices;
|
||||
index[cache_key] = utils::SkipList<Vertex>();
|
||||
indexed_vertices = &index[cache_key];
|
||||
index_deltas_storage_.emplace_back();
|
||||
index_deltas = &index_deltas_storage_.back();
|
||||
|
||||
@@ -743,8 +743,8 @@ VerticesIterable DiskStorage::DiskAccessor::Vertices(LabelId label, PropertyId p
|
||||
std::list<storage::Delta> *index_deltas{nullptr};
|
||||
|
||||
auto merge_with_main_cache = [&](auto &index) -> std::unordered_set<Gid> {
|
||||
index[cache_key] = VerticesWithFlag();
|
||||
indexed_vertices = &index[cache_key].vertices;
|
||||
index[cache_key] = utils::SkipList<Vertex>();
|
||||
indexed_vertices = &index[cache_key];
|
||||
index_deltas_storage_.emplace_back();
|
||||
index_deltas = &index_deltas_storage_.back();
|
||||
|
||||
@@ -830,8 +830,8 @@ VerticesIterable DiskStorage::DiskAccessor::Vertices(LabelId label, PropertyId p
|
||||
std::list<storage::Delta> *index_deltas{nullptr};
|
||||
|
||||
auto merge_with_main_cache = [&](auto &index) -> std::unordered_set<Gid> {
|
||||
index[cache_key] = VerticesWithFlag();
|
||||
indexed_vertices = &index[cache_key].vertices;
|
||||
index[cache_key] = utils::SkipList<Vertex>();
|
||||
indexed_vertices = &index[cache_key];
|
||||
index_deltas_storage_.emplace_back();
|
||||
index_deltas = &index_deltas_storage_.back();
|
||||
|
||||
@@ -1246,7 +1246,7 @@ std::optional<VertexAccessor> DiskStorage::DiskAccessor::FindVertex(storage::Gid
|
||||
|
||||
auto find_in_indices = [&](auto &index_storage) -> std::optional<VertexAccessor> {
|
||||
for (auto &[k, v] : index_storage) {
|
||||
acc = v.vertices.access();
|
||||
acc = v.access();
|
||||
auto index_it = acc.find(gid);
|
||||
if (index_it != acc.end()) {
|
||||
return VertexAccessor::Create(&*index_it, &transaction_, &storage_->indices_, &storage_->constraints_, config_,
|
||||
@@ -1647,7 +1647,7 @@ DiskStorage::DiskAccessor::ClearDanglingVertices() {
|
||||
|
||||
auto flush_index = [&](auto &index_storage) -> utils::BasicResult<StorageDataManipulationError, void> {
|
||||
for (const auto &[k, v] : index_storage) {
|
||||
if (auto vertices_res = FlushVertices(v.vertices.access(), unique_storage); vertices_res.HasError()) {
|
||||
if (auto vertices_res = FlushVertices(v.access(), unique_storage); vertices_res.HasError()) {
|
||||
return vertices_res.GetError();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,11 +267,6 @@ class DiskStorage final : public Storage {
|
||||
/// Main storage
|
||||
utils::SkipList<Vertex> vertices_;
|
||||
|
||||
struct VerticesWithFlag {
|
||||
utils::SkipList<Vertex> vertices;
|
||||
bool already_in_memory{false};
|
||||
};
|
||||
|
||||
using LabelIndex = LabelId;
|
||||
using LabelPropertyIndex = std::pair<LabelId, PropertyId>;
|
||||
using LabelPropertyValIndex = std::tuple<LabelId, PropertyId, PropertyValue>;
|
||||
@@ -279,28 +274,28 @@ class DiskStorage final : public Storage {
|
||||
using LabelPropertyRangeIndex = std::tuple<LabelId, PropertyId, RangeBoundary, RangeBoundary>;
|
||||
|
||||
// TODO rename these.
|
||||
std::map<LabelId, VerticesWithFlag> label_index_old_;
|
||||
std::map<LabelId, utils::SkipList<Vertex>> label_index_old_;
|
||||
uint64_t label_index_old_ci_{transaction_.command_id};
|
||||
|
||||
std::map<LabelId, VerticesWithFlag> label_index_new_;
|
||||
std::map<LabelId, utils::SkipList<Vertex>> label_index_new_;
|
||||
uint64_t label_index_new_ci_{transaction_.command_id};
|
||||
|
||||
std::map<LabelPropertyIndex, VerticesWithFlag> label_property_index_old_;
|
||||
std::map<LabelPropertyIndex, utils::SkipList<Vertex>> label_property_index_old_;
|
||||
uint64_t label_property_index_old_ci_{transaction_.command_id};
|
||||
|
||||
std::map<LabelPropertyIndex, VerticesWithFlag> label_property_index_new_;
|
||||
std::map<LabelPropertyIndex, utils::SkipList<Vertex>> label_property_index_new_;
|
||||
uint64_t label_property_index_new_ci_{transaction_.command_id};
|
||||
|
||||
std::map<LabelPropertyValIndex, VerticesWithFlag> label_property_val_index_old_;
|
||||
std::map<LabelPropertyValIndex, utils::SkipList<Vertex>> label_property_val_index_old_;
|
||||
uint64_t label_property_val_index_old_ci_{transaction_.command_id};
|
||||
|
||||
std::map<LabelPropertyValIndex, VerticesWithFlag> label_property_val_index_new_;
|
||||
std::map<LabelPropertyValIndex, utils::SkipList<Vertex>> label_property_val_index_new_;
|
||||
uint64_t label_property_val_index_new_ci_{transaction_.command_id};
|
||||
|
||||
std::map<LabelPropertyRangeIndex, VerticesWithFlag> label_property_range_index_old_;
|
||||
std::map<LabelPropertyRangeIndex, utils::SkipList<Vertex>> label_property_range_index_old_;
|
||||
uint64_t label_property_range_index_old_ci_{transaction_.command_id};
|
||||
|
||||
std::map<LabelPropertyRangeIndex, VerticesWithFlag> label_property_range_index_new_;
|
||||
std::map<LabelPropertyRangeIndex, utils::SkipList<Vertex>> label_property_range_index_new_;
|
||||
uint64_t label_property_range_index_new_ci_{transaction_.command_id};
|
||||
|
||||
/// We need them because query context for indexed reading is cleared after the query is done not after the
|
||||
|
||||
Reference in New Issue
Block a user