iceberg-cpp
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Friends | List of all members
iceberg::arrow::ArrowFileSystemFileIO Class Reference

A concrete implementation of FileIO for Arrow file system. More...

#include <arrow_io_internal.h>

Inheritance diagram for iceberg::arrow::ArrowFileSystemFileIO:
iceberg::FileIO

Public Member Functions

 ArrowFileSystemFileIO (std::shared_ptr<::arrow::fs::FileSystem > arrow_fs)
 
Result< std::unique_ptr< InputFile > > NewInputFile (std::string file_location) override
 Create an input file handle for the given location.
 
Result< std::unique_ptr< InputFile > > NewInputFile (std::string file_location, size_t length) override
 Create an input file handle for the given location with a known length.
 
Result< std::unique_ptr< OutputFile > > NewOutputFile (std::string file_location) override
 Create an output file handle for the given location.
 
Status DeleteFile (const std::string &file_location) override
 Delete a file at the given location.
 
const std::shared_ptr<::arrow::fs::FileSystem > & fs () const
 Get the Arrow file system.
 
- Public Member Functions inherited from iceberg::FileIO
virtual Result< std::string > ReadFile (const std::string &file_location, std::optional< size_t > length)
 Read the content of the file at the given location.
 
virtual Status WriteFile (const std::string &file_location, std::string_view content)
 Write the given content to the file at the given location.
 

Static Public Member Functions

static std::unique_ptr< FileIOMakeMockFileIO ()
 Make an in-memory FileIO backed by arrow::fs::internal::MockFileSystem.
 
static std::unique_ptr< FileIOMakeLocalFileIO ()
 Make a local FileIO backed by arrow::fs::LocalFileSystem.
 

Friends

Result< std::shared_ptr<::arrow::io::RandomAccessFile > > OpenArrowInputStream (const std::shared_ptr< FileIO > &io, const std::string &path, std::optional< size_t > length)
 Open a FileIO input as an Arrow input stream.
 
Result< std::shared_ptr<::arrow::io::OutputStream > > OpenArrowOutputStream (const std::shared_ptr< FileIO > &io, const std::string &path, bool overwrite)
 Open a FileIO output as an Arrow output stream.
 

Detailed Description

A concrete implementation of FileIO for Arrow file system.

Member Function Documentation

◆ DeleteFile()

Status iceberg::arrow::ArrowFileSystemFileIO::DeleteFile ( const std::string &  file_location)
overridevirtual

Delete a file at the given location.

Reimplemented from iceberg::FileIO.

◆ NewInputFile() [1/2]

Result< std::unique_ptr< InputFile > > iceberg::arrow::ArrowFileSystemFileIO::NewInputFile ( std::string  file_location)
overridevirtual

Create an input file handle for the given location.

Reimplemented from iceberg::FileIO.

◆ NewInputFile() [2/2]

Result< std::unique_ptr< InputFile > > iceberg::arrow::ArrowFileSystemFileIO::NewInputFile ( std::string  file_location,
size_t  length 
)
overridevirtual

Create an input file handle for the given location with a known length.

Reimplemented from iceberg::FileIO.

◆ NewOutputFile()

Result< std::unique_ptr< OutputFile > > iceberg::arrow::ArrowFileSystemFileIO::NewOutputFile ( std::string  file_location)
overridevirtual

Create an output file handle for the given location.

Reimplemented from iceberg::FileIO.

Friends And Related Symbol Documentation

◆ OpenArrowInputStream

Result< std::shared_ptr<::arrow::io::RandomAccessFile > > OpenArrowInputStream ( const std::shared_ptr< FileIO > &  io,
const std::string &  path,
std::optional< size_t >  length 
)
friend

Open a FileIO input as an Arrow input stream.

Uses ArrowFileSystemFileIO's native Arrow stream directly when possible and falls back to a FileIO stream adapter otherwise. The fallback requires FileIO to implement NewInputFile.

◆ OpenArrowOutputStream

Result< std::shared_ptr<::arrow::io::OutputStream > > OpenArrowOutputStream ( const std::shared_ptr< FileIO > &  io,
const std::string &  path,
bool  overwrite 
)
friend

Open a FileIO output as an Arrow output stream.

Uses ArrowFileSystemFileIO's native Arrow stream directly when possible and falls back to a FileIO stream adapter otherwise. The fallback requires FileIO to implement NewOutputFile.


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