Apache GraphAr C++ Library
The C++ Library for Apache GraphAr
|
EdgeBuilder is designed for building and writing a collection of edges. More...
#include <edges_builder.h>
Public Member Functions | |
EdgesBuilder (const std::shared_ptr< EdgeInfo > &edge_info, const std::string &prefix, AdjListType adj_list_type, IdType num_vertices, const ValidateLevel &validate_level=ValidateLevel::no_validate) | |
Initialize the EdgesBuilder. More... | |
void | SetValidateLevel (const ValidateLevel &validate_level) |
Set the validate level. More... | |
ValidateLevel | GetValidateLevel () const |
Get the validate level. More... | |
void | Clear () |
Clear the edges in this EdgesBuilder. | |
Status | AddEdge (const Edge &e, const ValidateLevel &validate_level=ValidateLevel::default_validate) |
Add an edge to the collection. More... | |
IdType | GetNum () const |
Get the current number of edges in the collection. More... | |
Status | Dump () |
Dump the collection into files. More... | |
Static Public Member Functions | |
static Result< std::shared_ptr< EdgesBuilder > > | Make (const std::shared_ptr< EdgeInfo > &edge_info, const std::string &prefix, AdjListType adj_list_type, IdType num_vertices, const ValidateLevel &validate_level=ValidateLevel::no_validate) |
Construct an EdgesBuilder from edge info. More... | |
static Result< std::shared_ptr< EdgesBuilder > > | Make (const std::shared_ptr< GraphInfo > &graph_info, const std::string &src_label, const std::string &edge_label, const std::string &dst_label, const AdjListType &adj_list_type, IdType num_vertices, const ValidateLevel &validate_level=ValidateLevel::no_validate) |
Construct an EdgesBuilder from graph info. More... | |
EdgeBuilder is designed for building and writing a collection of edges.
Definition at line 152 of file edges_builder.h.
|
inlineexplicit |
Initialize the EdgesBuilder.
edge_info | The edge info that describes the vertex type. |
prefix | The absolute prefix. |
adj_list_type | The adj list type of the edges. |
num_vertices | The total number of vertices for source or destination. |
validate_level | The global validate level for the writer, with no validate by default. It could be ValidateLevel::no_validate, ValidateLevel::weak_validate or ValidateLevel::strong_validate, but could not be ValidateLevel::default_validate. |
Definition at line 166 of file edges_builder.h.
|
inline |
Add an edge to the collection.
The validate_level for this operation could be:
ValidateLevel::default_validate: to use the validate_level of the builder, which set through the constructor or the SetValidateLevel method;
ValidateLevel::no_validate: without validation;
ValidateLevel::weak_validate: to validate if the adj_list type is valid, and the data in builder is not saved;
ValidateLevel::strong_validate: besides weak_validate, also validate the schema of the edge is consistent with the info defined.
e | The edge to add. |
validate_level | The validate level for this operation, which is the builder's validate level by default. |
Definition at line 250 of file edges_builder.h.
Status graphar::builder::EdgesBuilder::Dump | ( | ) |
Dump the collection into files.
Definition at line 29 of file edges_builder.cc.
|
inline |
Get the current number of edges in the collection.
Definition at line 266 of file edges_builder.h.
|
inline |
Get the validate level.
Definition at line 218 of file edges_builder.h.
|
inlinestatic |
Construct an EdgesBuilder from edge info.
edge_info | The edge info that describes the edge type. |
prefix | The absolute prefix. |
adj_list_type | The adj list type of the edges. |
num_vertices | The total number of vertices for source or destination. |
validate_level | The global validate level for the builder, default is no_validate. |
Definition at line 285 of file edges_builder.h.
|
inlinestatic |
Construct an EdgesBuilder from graph info.
graph_info | The graph info that describes the graph. |
src_label | The label of the source vertex type. |
edge_label | The label of the edge type. |
dst_label | The label of the destination vertex type. |
adj_list_type | The adj list type of the edges. |
num_vertices | The total number of vertices for source or destination. |
validate_level | The global validate level for the builder, default is no_validate. |
Definition at line 310 of file edges_builder.h.
|
inline |
Set the validate level.
validate_level | The validate level to set. |
Definition at line 206 of file edges_builder.h.