iceberg-cpp
Loading...
Searching...
No Matches
Public Member Functions | List of all members
iceberg::ResolvingFileIO Class Referencefinal

FileIO that resolves and caches implementations by registry name. More...

#include <resolving_file_io.h>

Inheritance diagram for iceberg::ResolvingFileIO:
iceberg::FileIO iceberg::SupportsStorageCredentials

Public Member Functions

 ResolvingFileIO (std::unordered_map< std::string, std::string > properties)
 
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.
 
Status DeleteFiles (const std::vector< std::string > &file_locations) override
 Delete files at the given locations.
 
Status SetStorageCredentials (const std::vector< StorageCredential > &storage_credentials) override
 Install vended storage credentials.
 
std::vector< StorageCredential > credentials () const override
 Return the credentials installed on this resolver.
 
Status InitializeStorageCredentials (const std::vector< StorageCredential > &storage_credentials, std::shared_ptr< StorageCredentialProvider > provider) override
 Install initial credentials before the first delegate is loaded.
 
const std::unordered_map< std::string, std::string > & properties () const override
 Return the configuration used to create this FileIO.
 
SupportsStorageCredentials * AsSupportsStorageCredentials () override
 Return storage-credential support when implemented by this FileIO.
 
- 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.
 

Detailed Description

FileIO that resolves and caches implementations by registry name.

Vended credentials and any credential provider are forwarded to every resolved implementation that supports them; each applies what it understands.

Member Function Documentation

◆ AsSupportsStorageCredentials()

SupportsStorageCredentials * iceberg::ResolvingFileIO::AsSupportsStorageCredentials ( )
inlineoverridevirtual

Return storage-credential support when implemented by this FileIO.

Reimplemented from iceberg::FileIO.

◆ credentials()

std::vector< StorageCredential > iceberg::ResolvingFileIO::credentials ( ) const
overridevirtual

Return the credentials installed on this resolver.

Not necessarily the ones in use: a resolved implementation refreshes its own without reporting back.

Implements iceberg::SupportsStorageCredentials.

◆ DeleteFile()

Status iceberg::ResolvingFileIO::DeleteFile ( const std::string &  )
overridevirtual

Delete a file at the given location.

Parameters
file_locationThe location of the file to delete.
Returns
Status indicating success, or an error if the delete failed.

Reimplemented from iceberg::FileIO.

◆ DeleteFiles()

Status iceberg::ResolvingFileIO::DeleteFiles ( const std::vector< std::string > &  file_locations)
overridevirtual

Delete files at the given locations.

Implementations that can delete multiple files efficiently should override this method. The default implementation deletes files sequentially using DeleteFile and returns the first error encountered.

Parameters
file_locationsThe locations of the files to delete.
Returns
Status indicating success, or an error if any delete fails.

Reimplemented from iceberg::FileIO.

◆ InitializeStorageCredentials()

Status iceberg::ResolvingFileIO::InitializeStorageCredentials ( const std::vector< StorageCredential > &  storage_credentials,
std::shared_ptr< StorageCredentialProvider >  provider 
)
overridevirtual

Install initial credentials before the first delegate is loaded.

Reimplemented from iceberg::SupportsStorageCredentials.

◆ NewInputFile() [1/2]

Result< std::unique_ptr< InputFile > > iceberg::ResolvingFileIO::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::ResolvingFileIO::NewInputFile ( std::string  file_location,
size_t  length 
)
overridevirtual

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

The length is a caller-provided content length hint. Implementations may use it to avoid an extra metadata lookup.

Reimplemented from iceberg::FileIO.

◆ NewOutputFile()

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

Create an output file handle for the given location.

Reimplemented from iceberg::FileIO.

◆ properties()

const std::unordered_map< std::string, std::string > & iceberg::ResolvingFileIO::properties ( ) const
inlineoverridevirtual

Return the configuration used to create this FileIO.

The returned map may contain credentials. Callers must not log or expose it. Implementations that do not expose their configuration return an empty map.

Reimplemented from iceberg::FileIO.

◆ SetStorageCredentials()

Status iceberg::ResolvingFileIO::SetStorageCredentials ( const std::vector< StorageCredential > &  storage_credentials)
overridevirtual

Install vended storage credentials.

Implements iceberg::SupportsStorageCredentials.


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