|
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, std::shared_ptr< WriterOptions > writerOptions=nullptr, const ValidateLevel &validate_level=ValidateLevel::no_validate) | |
| Initialize the EdgesBuilder. More... | |
| void | SetValidateLevel (const ValidateLevel &validate_level) |
| Set the validate level. More... | |
| void | SetWriterOptions (std::shared_ptr< WriterOptions > writer_options) |
| Set the writerOptions. More... | |
| std::shared_ptr< WriterOptions > | GetWriterOptions () |
| Set the writerOptions. 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, std::shared_ptr< WriterOptions > writer_options, 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< EdgeInfo > &edge_info, const std::string &prefix, AdjListType adj_list_type, IdType num_vertices, const ValidateLevel &validate_level=ValidateLevel::no_validate) |
| static Result< std::shared_ptr< EdgesBuilder > > | Make (const std::shared_ptr< GraphInfo > &graph_info, const std::string &src_type, const std::string &edge_type, const std::string &dst_type, const AdjListType &adj_list_type, IdType num_vertices, std::shared_ptr< WriterOptions > writer_options, const ValidateLevel &validate_level=ValidateLevel::no_validate) |
| Construct an EdgesBuilder from graph info. More... | |
| static Result< std::shared_ptr< EdgesBuilder > > | Make (const std::shared_ptr< GraphInfo > &graph_info, const std::string &src_type, const std::string &edge_type, const std::string &dst_type, const AdjListType &adj_list_type, IdType num_vertices, const ValidateLevel &validate_level=ValidateLevel::no_validate) |
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. |
| writerOptions | The writerOptions provides configuration options for different file format writers. |
| 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 168 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 273 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 289 of file edges_builder.h.
|
inline |
Get the validate level.
Definition at line 241 of file edges_builder.h.
|
inline |
Set the writerOptions.
| writerOptions | The writerOptions provides configuration options for different file format writers. |
Definition at line 232 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. |
| writerOptions | The writerOptions provides configuration options for different file format writers. |
| validate_level | The global validate level for the builder, default is no_validate. |
Definition at line 310 of file edges_builder.h.
|
inlinestatic |
Construct an EdgesBuilder from graph info.
| graph_info | The graph info that describes the graph. |
| src_type | The type of the source vertex type. |
| edge_type | The type of the edge type. |
| dst_type | The type 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 351 of file edges_builder.h.
|
inline |
Set the validate level.
| validate_level | The validate level to set. |
Definition at line 210 of file edges_builder.h.
|
inline |
Set the writerOptions.
Definition at line 223 of file edges_builder.h.