40class SupportsStorageCredentials;
51 virtual Status
Seek(int64_t position) = 0;
61 virtual Status
ReadFully(int64_t position, std::span<std::byte> out) = 0;
82 virtual Status
Write(std::span<const std::byte> data) = 0;
154 std::optional<size_t> length);
161 virtual Status
WriteFile(
const std::string& file_location, std::string_view content);
167 virtual Status
DeleteFile(
const std::string& file_location) {
168 return NotImplemented(
"DeleteFile not implemented");
179 virtual Status
DeleteFiles(
const std::vector<std::string>& file_locations);
194 const std::vector<StorageCredential>& storage_credentials) = 0;
197 virtual const std::vector<StorageCredential>&
credentials()
const = 0;
Pluggable module for reading, writing, and deleting files.
Definition file_io.h:128
virtual Result< std::unique_ptr< InputFile > > NewInputFile(std::string file_location, size_t length)
Create an input file handle for the given location with a known length.
virtual Result< std::unique_ptr< OutputFile > > NewOutputFile(std::string file_location)
Create an output file handle for the given location.
virtual SupportsStorageCredentials * AsSupportsStorageCredentials()
Return storage-credential support when implemented by this FileIO.
Definition file_io.h:182
virtual Status WriteFile(const std::string &file_location, std::string_view content)
Write the given content to the file at the given location.
virtual Result< std::unique_ptr< InputFile > > NewInputFile(std::string file_location)
Create an input file handle for the given location.
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 DeleteFiles(const std::vector< std::string > &file_locations)
Delete files at the given locations.
virtual Status DeleteFile(const std::string &file_location)
Delete a file at the given location.
Definition file_io.h:167
Handle for creating a writable file.
Definition file_io.h:107
virtual Result< std::unique_ptr< PositionOutputStream > > CreateOrOverwrite()=0
Create a new output stream, replacing any existing file.
virtual std::string_view location() const =0
File location represented by this handle.
virtual Result< std::unique_ptr< PositionOutputStream > > Create()=0
Create a new output stream and fail if the file already exists.
Positioned byte stream for writing file contents.
Definition file_io.h:68
virtual Result< int64_t > Position() const =0
Return the current write position.
virtual Status Write(std::span< const std::byte > data)=0
Write all bytes in data at the current position.
virtual Status Flush()=0
Flush buffered data to the underlying store.
virtual Status Close()=0
Close the stream. Implementations should allow repeated Close calls.
virtual Result< int64_t > StoredLength() const
Return the current stored length of the output.
Definition file_io.h:79
Mix-in for FileIO implementations that route object paths to per-prefix file systems built from vende...
Definition file_io.h:188
virtual Status SetStorageCredentials(const std::vector< StorageCredential > &storage_credentials)=0
Install vended storage credentials.
virtual const std::vector< StorageCredential > & credentials() const =0
Return currently installed storage credentials.
Define symbol visibility macros for core Iceberg APIs.
Core Apache Iceberg C++ APIs.
Definition arrow_io_util.h:33
std::expected< T, E > Result
Result alias.
Definition result.h:88
Define Result, Status, and error helpers.
Define storage credential metadata.