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

The arrow chunk reader for edge offset. More...

#include <chunk_reader.h>

Public Types

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

Public Member Functions

 AdjListOffsetArrowChunkReader (const std::shared_ptr< EdgeInfo > &edge_info, AdjListType adj_list_type, const std::string &prefix)
 Initialize the AdjListOffsetArrowChunkReader. More...
 
Status seek (IdType id)
 Sets chunk position indicator for reader by internal vertex id. If internal vertex id is not found, will return Status::IndexError error. After seeking to an invalid vertex id, the next call to GetChunk function may undefined, e.g. return an non exist path. More...
 
Result< std::shared_ptr< arrow::Array > > GetChunk ()
 Get the current offset chunk as arrow::Array.
 
Status next_chunk ()
 Sets chunk position indicator to next chunk. if current chunk is the last chunk, will return Status::IndexError error.
 
IdType GetChunkIndex () const noexcept
 Get current vertex chunk index.
 

Static Public Member Functions

static Result< std::shared_ptr< AdjListOffsetArrowChunkReader > > Make (const std::shared_ptr< EdgeInfo > &edge_info, AdjListType adj_list_type, const std::string &prefix)
 Create an AdjListOffsetArrowChunkReader instance from edge info. More...
 
static Result< std::shared_ptr< AdjListOffsetArrowChunkReader > > Make (const std::shared_ptr< GraphInfo > &graph_info, const std::string &src_label, const std::string &edge_label, const std::string &dst_label, AdjListType adj_list_type)
 Create an AdjListOffsetArrowChunkReader instance from graph info. More...
 

Detailed Description

The arrow chunk reader for edge offset.

Definition at line 271 of file chunk_reader.h.

Constructor & Destructor Documentation

◆ AdjListOffsetArrowChunkReader()

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

Initialize the AdjListOffsetArrowChunkReader.

Parameters
edge_infoThe edge info that describes the edge type.
adj_list_typeThe adj list type for the edges. Note that the adj list type must be AdjListType::ordered_by_source or AdjListType::ordered_by_dest.
prefixThe absolute prefix.

Definition at line 468 of file chunk_reader.cc.

Member Function Documentation

◆ Make() [1/2]

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

Create an AdjListOffsetArrowChunkReader 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 544 of file chunk_reader.cc.

◆ Make() [2/2]

Result< std::shared_ptr< AdjListOffsetArrowChunkReader > > graphar::AdjListOffsetArrowChunkReader::Make ( const std::shared_ptr< GraphInfo > &  graph_info,
const std::string &  src_label,
const std::string &  edge_label,
const std::string &  dst_label,
AdjListType  adj_list_type 
)
static

Create an AdjListOffsetArrowChunkReader instance from graph info.

Parameters
graph_infoThe graph info.
src_labelThe source vertex label.
edge_labelThe edge label.
dst_labelThe destination vertex label.
adj_list_typeThe adj list type for the edges.

Definition at line 557 of file chunk_reader.cc.

◆ seek()

Status graphar::AdjListOffsetArrowChunkReader::seek ( IdType  id)

Sets chunk position indicator for reader by internal vertex id. If internal vertex id is not found, will return Status::IndexError error. After seeking to an invalid vertex id, the next call to GetChunk function may undefined, e.g. return an non exist path.

Parameters
idthe internal vertex id.

Definition at line 498 of file chunk_reader.cc.


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