Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions include/neug/storages/csr/immutable_csr.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ class ImmutableCsr : public TypedCsrBase<EDATA_T> {

size_t capacity() const override;

void Close();

void batch_sort_by_edge_data(timestamp_t ts) override;

void batch_delete_vertices(const std::set<vid_t>& src_set,
Expand Down Expand Up @@ -163,8 +161,6 @@ class SingleImmutableCsr : public TypedCsrBase<EDATA_T> {

size_t capacity() const override;

void Close();

void batch_sort_by_edge_data(timestamp_t ts) override;

void batch_delete_vertices(const std::set<vid_t>& src_set,
Expand Down
4 changes: 0 additions & 4 deletions include/neug/storages/csr/mutable_csr.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ class MutableCsr : public TypedCsrBase<EDATA_T> {

size_t capacity() const override;

void Close();

void batch_sort_by_edge_data(timestamp_t ts) override;

void batch_delete_vertices(const std::set<vid_t>& src_set,
Expand Down Expand Up @@ -242,8 +240,6 @@ class SingleMutableCsr : public TypedCsrBase<EDATA_T> {

size_t capacity() const override;

void Close();

void batch_sort_by_edge_data(timestamp_t ts) override;

void batch_delete_vertices(const std::set<vid_t>& src_set,
Expand Down
2 changes: 0 additions & 2 deletions include/neug/storages/graph/edge_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ class EdgeTable {
return meta_;
}

void Close();

void SortByEdgeData(timestamp_t ts);

void BatchDeleteVertices(const std::set<vid_t>& src_set,
Expand Down
26 changes: 13 additions & 13 deletions include/neug/storages/graph/property_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -339,12 +339,12 @@ class PropertyGraph {

inline VertexTable& get_vertex_table(label_t vertex_label) {
schema_.ensure_vertex_label_valid(vertex_label);
return vertex_tables_[vertex_label];
return *vertex_tables_[vertex_label];
}

inline const VertexTable& get_vertex_table(label_t vertex_label) const {
schema_.ensure_vertex_label_valid(vertex_label);
return vertex_tables_[vertex_label];
return *vertex_tables_[vertex_label];
}

inline EdgeTable& get_edge_table(label_t src_label, label_t dst_label,
Expand All @@ -355,7 +355,7 @@ class PropertyGraph {
THROW_INVALID_ARGUMENT_EXCEPTION(
"Edge table for edge label triplet not found");
}
return edge_tables_.at(index);
return *edge_tables_.at(index);
}

inline const EdgeTable& get_edge_table(label_t src_label, label_t dst_label,
Expand All @@ -366,7 +366,7 @@ class PropertyGraph {
THROW_INVALID_ARGUMENT_EXCEPTION(
"Edge table for edge label triplet not found");
}
return edge_tables_.at(index);
return *edge_tables_.at(index);
}

vid_t LidNum(label_t vertex_label) const;
Expand Down Expand Up @@ -447,7 +447,7 @@ class PropertyGraph {
THROW_INVALID_ARGUMENT_EXCEPTION(
"Edge table for edge label triplet not found");
}
return edge_tables_.at(index).get_outgoing_view(ts);
return edge_tables_.at(index)->get_outgoing_view(ts);
}

/**
Expand Down Expand Up @@ -492,7 +492,7 @@ class PropertyGraph {
THROW_INVALID_ARGUMENT_EXCEPTION(
"Edge table for edge label triplet not found");
}
return edge_tables_.at(index).get_incoming_view(ts);
return edge_tables_.at(index)->get_incoming_view(ts);
}

/**
Expand Down Expand Up @@ -521,7 +521,7 @@ class PropertyGraph {
THROW_INVALID_ARGUMENT_EXCEPTION(
"Edge table for edge label triplet not found");
}
return edge_tables_.at(index).get_edge_data_accessor(prop_id);
return edge_tables_.at(index)->get_edge_data_accessor(prop_id);
}

/**
Expand Down Expand Up @@ -561,7 +561,7 @@ class PropertyGraph {
THROW_INVALID_ARGUMENT_EXCEPTION(
"Edge table for edge label triplet not found");
}
return edge_table_it->second.get_edge_data_accessor(prop);
return edge_table_it->second->get_edge_data_accessor(prop);
}

void loadSchema(const std::string& filename);
Expand All @@ -574,19 +574,19 @@ class PropertyGraph {
"Vertex property column id out of range: " + std::to_string(col_id) +
" (label has " + std::to_string(props.size()) + " properties)");
}
return vertex_tables_[label].GetPropertyColumn(col_id);
return vertex_tables_[label]->GetPropertyColumn(col_id);
}

inline std::shared_ptr<RefColumnBase> GetVertexPropertyColumn(
uint8_t label, const std::string& prop) const {
schema_.ensure_vertex_label_valid(label);
return vertex_tables_[label].GetPropertyColumn(prop);
return vertex_tables_[label]->GetPropertyColumn(prop);
}

inline VertexSet GetVertexSet(label_t label,
timestamp_t ts = MAX_TIMESTAMP) const {
schema_.ensure_vertex_label_valid(label);
return vertex_tables_[label].GetVertexSet(ts);
return vertex_tables_[label]->GetVertexSet(ts);
}

std::string get_statistics_json() const;
Expand Down Expand Up @@ -617,8 +617,8 @@ class PropertyGraph {
std::shared_ptr<Checkpoint> ckp_;
Schema schema_;
std::vector<std::shared_ptr<std::mutex>> v_mutex_;
std::vector<VertexTable> vertex_tables_;
std::unordered_map<uint32_t, EdgeTable> edge_tables_;
std::vector<std::unique_ptr<VertexTable>> vertex_tables_;
std::unordered_map<uint32_t, std::unique_ptr<EdgeTable>> edge_tables_;

size_t vertex_label_total_count_, edge_label_total_count_;
MemoryLevel memory_level_;
Expand Down
2 changes: 0 additions & 2 deletions include/neug/storages/graph/vertex_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ class VertexTable {
return std::move(v_ts_);
}

void Close();

void SetVertexSchema(std::shared_ptr<const VertexSchema> vertex_schema);

std::shared_ptr<const VertexSchema> get_vertex_schema_ptr() const {
Expand Down
4 changes: 0 additions & 4 deletions include/neug/storages/graph/vertex_timestamp.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ class VertexTimestamp : public Module {

void Reset();

void Clear();

inline void InsertVertex(vid_t v, timestamp_t ts) {
if (v < init_vertex_num_) {
if (ts == 0) {
Expand Down Expand Up @@ -164,8 +162,6 @@ class VertexTimestamp : public Module {

const vid_t InitVertexNum() const { return init_vertex_num_; }

void Close();

private:
void load_ts(const std::string& ts_filename);
void dump_ts(const std::string& ts_filename);
Expand Down
5 changes: 0 additions & 5 deletions include/neug/utils/id_indexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -438,11 +438,6 @@ class LFIndexer {
return keys_->get_prop(index);
}

void Close() {
keys_.reset();
indices_.reset();
}

// get keys
const ColumnBase& get_keys() const { return *keys_; }

Expand Down
7 changes: 0 additions & 7 deletions include/neug/utils/property/column.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ class TypedColumn : public ColumnBase {
size_ = buffer_->GetDataSize() / sizeof(T);
}

void Close() { buffer_.reset(); }

ModuleDescriptor Dump(Checkpoint& ckp) override {
ModuleDescriptor desc;
desc.set_path(ModuleDescriptor::kDataPath, ckp.Commit(*buffer_));
Expand Down Expand Up @@ -261,11 +259,6 @@ class TypedColumn<std::string_view> : public ColumnBase {
assert(pos_.load() <= data_buffer_->GetDataSize());
}

void Close() {
items_buffer_.reset();
data_buffer_.reset();
}

bool is_data_unmodified() const {
if (items_buffer_->IsDirty() || items_buffer_->GetPath().empty()) {
return false;
Expand Down
2 changes: 0 additions & 2 deletions include/neug/utils/property/table.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ class Table {

void ingest(uint32_t index, OutArchive& arc);

void close();

private:
std::unordered_map<std::string, int> col_id_map_;
std::vector<std::string> col_names_;
Expand Down
12 changes: 0 additions & 12 deletions src/storages/csr/immutable_csr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,6 @@ size_t ImmutableCsr<EDATA_T>::capacity() const {
return CsrBase::INFINITE_CAPACITY;
}

template <typename EDATA_T>
void ImmutableCsr<EDATA_T>::Close() {
adj_list_buffer_.reset();
degree_list_buffer_.reset();
nbr_list_buffer_.reset();
}

template <typename EDATA_T>
void ImmutableCsr<EDATA_T>::batch_sort_by_edge_data(timestamp_t ts) {
if (!degree_list_buffer_) {
Expand Down Expand Up @@ -406,11 +399,6 @@ size_t SingleImmutableCsr<EDATA_T>::capacity() const {
return size();
}

template <typename EDATA_T>
void SingleImmutableCsr<EDATA_T>::Close() {
nbr_list_buffer_.reset();
}

template <typename EDATA_T>
void SingleImmutableCsr<EDATA_T>::batch_sort_by_edge_data(timestamp_t ts) {}

Expand Down
14 changes: 0 additions & 14 deletions src/storages/csr/mutable_csr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,6 @@ size_t MutableCsr<EDATA_T>::capacity() const {
return CsrBase::INFINITE_CAPACITY;
}

template <typename EDATA_T>
void MutableCsr<EDATA_T>::Close() {
locks_.reset();
adj_list_buffer_.reset();
degree_list_.reset();
cap_list_.reset();
nbr_list_.reset();
}

template <typename EDATA_T>
void MutableCsr<EDATA_T>::batch_sort_by_edge_data(timestamp_t ts) {
if (adj_list_buffer_ != nullptr) {
Expand Down Expand Up @@ -558,11 +549,6 @@ size_t SingleMutableCsr<EDATA_T>::capacity() const {
return vertex_capacity();
}

template <typename EDATA_T>
void SingleMutableCsr<EDATA_T>::Close() {
nbr_list_.reset();
}

template <typename EDATA_T>
void SingleMutableCsr<EDATA_T>::batch_sort_by_edge_data(timestamp_t ts) {}

Expand Down
8 changes: 0 additions & 8 deletions src/storages/graph/edge_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -553,13 +553,6 @@ void EdgeTable::SetEdgeSchema(std::shared_ptr<const EdgeSchema> meta) {
meta_ = meta;
}

void EdgeTable::Close() {
out_csr_.reset();
in_csr_.reset();
if (table_) {
table_->close();
}
}

void EdgeTable::SortByEdgeData(timestamp_t ts) {
// TODO
Expand Down Expand Up @@ -1007,7 +1000,6 @@ void EdgeTable::dropAndCreateNewBundledCSR(
new_in_csr.get());
}

table_->close();
table_ = std::make_unique<Table>();
table_idx_.store(0);
capacity_.store(0);
Expand Down
Loading
Loading