libgrape-lite
A C++ library for parallel graph processing
Public Member Functions | List of all members
grape::IOAdaptorBase Class Referenceabstract

IOAdaptorBase is the base class of I/O adaptors. More...

#include <io_adaptor_base.h>

Inheritance diagram for grape::IOAdaptorBase:
grape::LocalIOAdaptor

Public Member Functions

virtual void Open ()=0
 
virtual void Open (const char *mode)=0
 
virtual void Close ()=0
 
virtual bool Configure (const std::string &key, const std::string &value)=0
 Configure sub-class specific items. e.g., odps_access_key = abcd; oss_read_concurrency = 16; whether ReadLine for local location uses std::getline;.
 
virtual bool SetPartialRead (int index, int total_parts)=0
 Set each worker only scan related parts of the whole file. More...
 
virtual bool ReadLine (std::string &line)=0
 
virtual bool ReadArchive (OutArchive &archive)=0
 
virtual bool WriteArchive (InArchive &archive)=0
 
virtual bool Read (void *buffer, size_t size)=0
 
virtual bool Write (void *buffer, size_t size)=0
 
virtual void MakeDirectory (const std::string &path)=0
 
virtual bool IsExist ()=0
 

Detailed Description

IOAdaptorBase is the base class of I/O adaptors.

Note
: The pure virtual functions in the class work as interfaces, instructing sub-classes to implement. The override functions in the derived classes would be invoked directly, not via virtual functions.

Member Function Documentation

◆ SetPartialRead()

virtual bool grape::IOAdaptorBase::SetPartialRead ( int  index,
int  total_parts 
)
pure virtual

Set each worker only scan related parts of the whole file.

for local: read with offset, from a big file.

Implemented in grape::LocalIOAdaptor.