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

#include <arrow/io/file.h>

Inheritance diagram for arrow::io::MemoryMappedFile:
arrow::io::ReadWriteFileInterface arrow::io::RandomAccessFile arrow::io::WriteableFile arrow::io::InputStream arrow::io::Seekable arrow::io::OutputStream arrow::io::Seekable arrow::io::FileInterface arrow::io::Readable arrow::io::FileInterface arrow::io::Writeable

Public Member Functions

 ~MemoryMappedFile ()
 
Status Close () override
 
Status Tell (int64_t *position) const override
 
Status Seek (int64_t position) override
 
Status Read (int64_t nbytes, int64_t *bytes_read, uint8_t *out) override
 
Status Read (int64_t nbytes, std::shared_ptr< Buffer > *out) override
 
Status ReadAt (int64_t position, int64_t nbytes, int64_t *bytes_read, uint8_t *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
 Default implementation is thread-safe. More...
 
bool supports_zero_copy () const override
 
Status Write (const uint8_t *data, int64_t nbytes) override
 Write data at the current position in the file. Thread-safe. More...
 
Status WriteAt (int64_t position, const uint8_t *data, int64_t nbytes) override
 Write data at a particular position in the file. Thread-safe. More...
 
Status GetSize (int64_t *size) override
 
int file_descriptor () 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::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
 
- Public Member Functions inherited from arrow::io::Writeable
virtual ~Writeable ()=default
 
virtual Status Flush ()
 Flush buffered bytes, if any. More...
 
Status Write (const std::string &data)
 

Static Public Member Functions

static Status Create (const std::string &path, int64_t size, std::shared_ptr< MemoryMappedFile > *out)
 Create new file with indicated size, return in read/write mode. More...
 
static Status Open (const std::string &path, FileMode::type mode, std::shared_ptr< MemoryMappedFile > *out)
 

Additional Inherited Members

- Protected Member Functions inherited from arrow::io::ReadWriteFileInterface
 ReadWriteFileInterface ()
 
- 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)
 
- Protected Member Functions inherited from arrow::io::WriteableFile
 WriteableFile ()=default
 
- Protected Member Functions inherited from arrow::io::OutputStream
 OutputStream ()=default
 
- Protected Attributes inherited from arrow::io::FileInterface
FileMode::type mode_
 

Constructor & Destructor Documentation

◆ ~MemoryMappedFile()

arrow::io::MemoryMappedFile::~MemoryMappedFile ( )

Member Function Documentation

◆ Close()

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

◆ Create()

static Status arrow::io::MemoryMappedFile::Create ( const std::string &  path,
int64_t  size,
std::shared_ptr< MemoryMappedFile > *  out 
)
static

Create new file with indicated size, return in read/write mode.

◆ file_descriptor()

int arrow::io::MemoryMappedFile::file_descriptor ( ) const

◆ GetSize()

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

◆ Open()

static Status arrow::io::MemoryMappedFile::Open ( const std::string &  path,
FileMode::type  mode,
std::shared_ptr< MemoryMappedFile > *  out 
)
static

◆ Read() [1/2]

Status arrow::io::MemoryMappedFile::Read ( int64_t  nbytes,
int64_t *  bytes_read,
uint8_t *  out 
)
overridevirtual

Implements arrow::io::Readable.

◆ Read() [2/2]

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

Implements arrow::io::Readable.

◆ ReadAt() [1/2]

Status arrow::io::MemoryMappedFile::ReadAt ( int64_t  position,
int64_t  nbytes,
int64_t *  bytes_read,
uint8_t *  out 
)
overridevirtual

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

Default implementation is thread-safe.

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::MemoryMappedFile::ReadAt ( int64_t  position,
int64_t  nbytes,
std::shared_ptr< Buffer > *  out 
)
overridevirtual

Default implementation is thread-safe.

Implements arrow::io::RandomAccessFile.

◆ Seek()

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

Implements arrow::io::Seekable.

◆ supports_zero_copy()

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

◆ Tell()

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

◆ Write()

Status arrow::io::MemoryMappedFile::Write ( const uint8_t *  data,
int64_t  nbytes 
)
overridevirtual

Write data at the current position in the file. Thread-safe.

Implements arrow::io::Writeable.

◆ WriteAt()

Status arrow::io::MemoryMappedFile::WriteAt ( int64_t  position,
const uint8_t *  data,
int64_t  nbytes 
)
overridevirtual

Write data at a particular position in the file. Thread-safe.

Implements arrow::io::WriteableFile.


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