Apache GraphAr C++ Library
The C++ Library for Apache GraphAr
Public Types | Public Member Functions | Static Public Member Functions | List of all members
graphar::AdjListArrowChunkReader Class Reference

The arrow chunk reader for adj list topology chunk. More...

#include <chunk_reader.h>

Public Types

using range_t = std::pair< IdType, IdType >
 

Public Member Functions

 AdjListArrowChunkReader (const std::shared_ptr< EdgeInfo > &edge_info, AdjListType adj_list_type, const std::string &prefix)
 Initialize the AdjListArrowChunkReader. More...
 
 AdjListArrowChunkReader (const AdjListArrowChunkReader &other)
 Copy constructor.
 
Status seek_src (IdType id)
 Sets chunk position indicator for reader by source vertex id. More...
 
Status seek_dst (IdType offset)
 Sets chunk position indicator for reader by destination vertex id. More...
 
Status seek (IdType offset)
 Sets chunk position indicator for reader by edge index. More...
 
Result< std::shared_ptr< arrow::Table > > GetChunk ()
 Return the current chunk of chunk position indicator as arrow::Table, if the chunk is empty, return nullptr.
 
Result< IdType > GetRowNumOfChunk ()
 Get the number of rows of the current chunk table.
 
Status next_chunk ()
 Sets chunk position indicator to next chunk. More...
 
Status seek_chunk_index (IdType vertex_chunk_index, IdType chunk_index=0)
 Sets chunk position to the specific vertex chunk and edge chunk. More...
 

Static Public Member Functions

static Result< std::shared_ptr< AdjListArrowChunkReader > > Make (const std::shared_ptr< EdgeInfo > &edge_info, AdjListType adj_list_type, const std::string &prefix)
 Create an AdjListArrowChunkReader instance from edge info. More...
 
static Result< std::shared_ptr< AdjListArrowChunkReader > > Make (const std::shared_ptr< GraphInfo > &graph_info, const std::string &src_type, const std::string &edge_type, const std::string &dst_type, AdjListType adj_list_type)
 Create an AdjListArrowChunkReader instance from graph info. More...
 

Detailed Description

The arrow chunk reader for adj list topology chunk.

Definition at line 277 of file chunk_reader.h.

Constructor & Destructor Documentation

◆ AdjListArrowChunkReader()

graphar::AdjListArrowChunkReader::AdjListArrowChunkReader ( const std::shared_ptr< EdgeInfo > &  edge_info,
AdjListType  adj_list_type,
const std::string &  prefix 
)

Initialize the AdjListArrowChunkReader.

Parameters
edge_infoThe edge info that describes the edge type.
adj_list_typeThe adj list type for the edge.
prefixThe absolute prefix.

Definition at line 516 of file chunk_reader.cc.

Member Function Documentation

◆ Make() [1/2]

Result< std::shared_ptr< AdjListArrowChunkReader > > graphar::AdjListArrowChunkReader::Make ( const std::shared_ptr< EdgeInfo > &  edge_info,
AdjListType  adj_list_type,
const std::string &  prefix 
)
static

Create an AdjListArrowChunkReader instance from edge info.

Parameters
edge_infoThe edge info.
adj_list_typeThe adj list type for the edges.
prefixThe absolute prefix of the graph.

Definition at line 703 of file chunk_reader.cc.

◆ Make() [2/2]

Result< std::shared_ptr< AdjListArrowChunkReader > > graphar::AdjListArrowChunkReader::Make ( const std::shared_ptr< GraphInfo > &  graph_info,
const std::string &  src_type,
const std::string &  edge_type,
const std::string &  dst_type,
AdjListType  adj_list_type 
)
static

Create an AdjListArrowChunkReader instance from graph info.

Parameters
graph_infoThe graph info.
src_typeThe source vertex type.
edge_typeThe edge type.
dst_typeThe destination vertex type.
adj_list_typeThe adj list type for the edges.

Definition at line 715 of file chunk_reader.cc.

◆ next_chunk()

Status graphar::AdjListArrowChunkReader::next_chunk ( )

Sets chunk position indicator to next chunk.

Returns
Status: ok or EndOfChunk error if the reader is at the end of current vertex chunk, or IndexError error if the reader is at the end of all vertex chunks.

Definition at line 655 of file chunk_reader.cc.

◆ seek()

Status graphar::AdjListArrowChunkReader::seek ( IdType  offset)

Sets chunk position indicator for reader by edge index.

Parameters
offsetedge index of the vertex chunk. Note: the offset is the edge index of the vertex chunk, not the edge index of the whole graph.

Definition at line 615 of file chunk_reader.cc.

◆ seek_chunk_index()

Status graphar::AdjListArrowChunkReader::seek_chunk_index ( IdType  vertex_chunk_index,
IdType  chunk_index = 0 
)

Sets chunk position to the specific vertex chunk and edge chunk.

Parameters
vertex_chunk_indexthe vertex chunk index.
chunk_indexthe edge chunk index of vertex_chunk_index.
Returns
Status: ok or error

Definition at line 676 of file chunk_reader.cc.

◆ seek_dst()

Status graphar::AdjListArrowChunkReader::seek_dst ( IdType  offset)

Sets chunk position indicator for reader by destination vertex id.

Parameters
idthe destination vertex id.

Definition at line 583 of file chunk_reader.cc.

◆ seek_src()

Status graphar::AdjListArrowChunkReader::seek_src ( IdType  id)

Sets chunk position indicator for reader by source vertex id.

Parameters
idthe source vertex id.

Definition at line 550 of file chunk_reader.cc.


The documentation for this class was generated from the following files: