Apache Arrow (C++)
A columnar in-memory analytics layer designed to accelerate big data.
Public Member Functions | Protected Attributes | List of all members
arrow::io::BufferReader Class Reference

Random access zero-copy reads on an arrow::Buffer. More...

#include <arrow/io/memory.h>

Inheritance diagram for arrow::io::BufferReader:
arrow::io::RandomAccessFile arrow::io::InputStream arrow::io::Seekable arrow::io::FileInterface arrow::io::Readable arrow::gpu::CudaBufferReader

Public Member Functions

 BufferReader (const std::shared_ptr< Buffer > &buffer)
 
 BufferReader (const Buffer &buffer)
 
 BufferReader (const uint8_t *data, int64_t size)
 
Status Close () override
 
Status Tell (int64_t *position) const override
 
Status Read (int64_t nbytes, int64_t *bytes_read, void *buffer) override
 
Status Read (int64_t nbytes, std::shared_ptr< Buffer > *out) override
 
Status ReadAt (int64_t position, int64_t nbytes, int64_t *bytes_read, void *out) override
 Read nbytes at position, provide default implementations using Read(...), but can be overridden. More...
 
Status ReadAt (int64_t position, int64_t nbytes, std::shared_ptr< Buffer > *out) override
 Read nbytes at position, provide default implementations using Read(...), but can be overridden. More...
 
Status GetSize (int64_t *size) override
 
Status Seek (int64_t position) override
 
bool supports_zero_copy () const override
 
std::shared_ptr< Bufferbuffer () const
 
- Public Member Functions inherited from arrow::io::RandomAccessFile
 ~RandomAccessFile () override
 Necessary because we hold a std::unique_ptr. More...
 
- Public Member Functions inherited from arrow::io::InputStream
Status Advance (int64_t nbytes)
 Advance or skip stream indicated number of bytes. More...
 
- Public Member Functions inherited from arrow::io::FileInterface
virtual ~FileInterface ()=0
 
FileMode::type mode () const
 
- Public Member Functions inherited from arrow::io::Readable
virtual ~Readable ()=default
 
- Public Member Functions inherited from arrow::io::Seekable
virtual ~Seekable ()=default
 

Protected Attributes

std::shared_ptr< Bufferbuffer_
 
const uint8_t * data_
 
int64_t size_
 
int64_t position_
 
- Protected Attributes inherited from arrow::io::FileInterface
FileMode::type mode_
 

Additional Inherited Members

- Protected Member Functions inherited from arrow::io::RandomAccessFile
 RandomAccessFile ()
 
- Protected Member Functions inherited from arrow::io::InputStream
 InputStream ()=default
 
- Protected Member Functions inherited from arrow::io::FileInterface
 FileInterface ()
 
void set_mode (FileMode::type mode)
 

Detailed Description

Random access zero-copy reads on an arrow::Buffer.

Constructor & Destructor Documentation

◆ BufferReader() [1/3]

arrow::io::BufferReader::BufferReader ( const std::shared_ptr< Buffer > &  buffer)
explicit

◆ BufferReader() [2/3]

arrow::io::BufferReader::BufferReader ( const Buffer buffer)
explicit

◆ BufferReader() [3/3]

arrow::io::BufferReader::BufferReader ( const uint8_t *  data,
int64_t  size 
)

Member Function Documentation

◆ buffer()

std::shared_ptr<Buffer> arrow::io::BufferReader::buffer ( ) const
inline

◆ Close()

Status arrow::io::BufferReader::Close ( )
overridevirtual

◆ GetSize()

Status arrow::io::BufferReader::GetSize ( int64_t *  size)
overridevirtual

◆ Read() [1/2]

Status arrow::io::BufferReader::Read ( int64_t  nbytes,
int64_t *  bytes_read,
void *  buffer 
)
overridevirtual

Implements arrow::io::Readable.

◆ Read() [2/2]

Status arrow::io::BufferReader::Read ( int64_t  nbytes,
std::shared_ptr< Buffer > *  out 
)
overridevirtual

Implements arrow::io::Readable.

◆ ReadAt() [1/2]

Status arrow::io::BufferReader::ReadAt ( int64_t  position,
int64_t  nbytes,
int64_t *  bytes_read,
void *  out 
)
overridevirtual

Read nbytes at position, provide default implementations using Read(...), but can be overridden.

Default implementation is thread-safe. It is unspecified whether this method updates the file position or not.

Note
Child classes must explicitly call this implementation or provide their own.
Parameters
[in]positionWhere to read bytes from
[in]nbytesThe number of bytes to read
[out]bytes_readThe number of bytes read
[out]outThe buffer to read bytes into
Returns
Status

Implements arrow::io::RandomAccessFile.

◆ ReadAt() [2/2]

Status arrow::io::BufferReader::ReadAt ( int64_t  position,
int64_t  nbytes,
std::shared_ptr< Buffer > *  out 
)
overridevirtual

Read nbytes at position, provide default implementations using Read(...), but can be overridden.

Default implementation is thread-safe. It is unspecified whether this method updates the file position or not.

Note
Child classes must explicitly call this implementation or provide their own.
Parameters
[in]positionWhere to read bytes from
[in]nbytesThe number of bytes to read
[out]outThe buffer to read bytes into. The number of bytes read can be retrieved by calling Buffer::size().

Implements arrow::io::RandomAccessFile.

◆ Seek()

Status arrow::io::BufferReader::Seek ( int64_t  position)
overridevirtual

Implements arrow::io::Seekable.

◆ supports_zero_copy()

bool arrow::io::BufferReader::supports_zero_copy ( ) const
overridevirtual

◆ Tell()

Status arrow::io::BufferReader::Tell ( int64_t *  position) const
overridevirtual

Member Data Documentation

◆ buffer_

std::shared_ptr<Buffer> arrow::io::BufferReader::buffer_
protected

◆ data_

const uint8_t* arrow::io::BufferReader::data_
protected

◆ position_

int64_t arrow::io::BufferReader::position_
protected

◆ size_

int64_t arrow::io::BufferReader::size_
protected

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