Write manifest entries to a manifest file.
More...
#include <manifest_writer.h>
|
| Status | WriteEntry (const ManifestEntry &entry) |
| | Write the entry that all its fields are populated correctly.
|
| |
| Status | WriteAddedEntry (std::shared_ptr< DataFile > file, std::optional< int64_t > data_sequence_number=std::nullopt) |
| | Add an added entry for a file with a specific sequence number.
|
| |
|
Status | WriteAddedEntry (const ManifestEntry &entry) |
| | Add a new entry to the manifest. The method populates the snapshot id and status fields of the entry.
|
| |
| Status | WriteExistingEntry (std::shared_ptr< DataFile > file, int64_t file_snapshot_id, int64_t data_sequence_number, std::optional< int64_t > file_sequence_number=std::nullopt) |
| | Add an existing entry for a file.
|
| |
|
Status | WriteExistingEntry (const ManifestEntry &entry) |
| | Add an existing entry to the manifest. The method populates the status field of the entry.
|
| |
| Status | WriteDeletedEntry (std::shared_ptr< DataFile > file, int64_t data_sequence_number, std::optional< int64_t > file_sequence_number=std::nullopt) |
| | Add a delete entry for a file.
|
| |
|
Status | WriteDeletedEntry (const ManifestEntry &entry) |
| | Add a deleted entry to the manifest. The method populates the snapshot id and status fields of the entry.
|
| |
| Status | AddAll (const std::vector< ManifestEntry > &entries) |
| | Write manifest entries to file.
|
| |
|
Status | Close () |
| | Close writer and flush to storage.
|
| |
|
ManifestContent | content () const |
| | Get the content of the manifest.
|
| |
| Result< Metrics > | metrics () const |
| | Get the metrics of written manifest file.
|
| |
| Result< int64_t > | length () const |
| | Get the current length of the manifest file in bytes.
|
| |
| Result< ManifestFile > | ToManifestFile () const |
| | Get the ManifestFile object.
|
| |
|
| static Result< std::unique_ptr< ManifestWriter > > | MakeWriter (int8_t format_version, std::optional< int64_t > snapshot_id, std::string_view manifest_location, std::shared_ptr< FileIO > file_io, std::shared_ptr< PartitionSpec > partition_spec, std::shared_ptr< Schema > current_schema, ManifestContent content=ManifestContent::kData, std::optional< int64_t > first_row_id=std::nullopt) |
| | Factory function to create a writer for a manifest file based on format version.
|
| |
Write manifest entries to a manifest file.
◆ AddAll()
| Status iceberg::ManifestWriter::AddAll |
( |
const std::vector< ManifestEntry > & |
entries | ) |
|
Write manifest entries to file.
- Parameters
-
| entries | Already populated manifest entries to write. |
- Returns
- Status indicating success or failure
◆ length()
| Result< int64_t > iceberg::ManifestWriter::length |
( |
| ) |
const |
Get the current length of the manifest file in bytes.
- Returns
- The current length of the file, or an error if the operation fails.
◆ MakeWriter()
| Result< std::unique_ptr< ManifestWriter > > iceberg::ManifestWriter::MakeWriter |
( |
int8_t |
format_version, |
|
|
std::optional< int64_t > |
snapshot_id, |
|
|
std::string_view |
manifest_location, |
|
|
std::shared_ptr< FileIO > |
file_io, |
|
|
std::shared_ptr< PartitionSpec > |
partition_spec, |
|
|
std::shared_ptr< Schema > |
current_schema, |
|
|
ManifestContent |
content = ManifestContent::kData, |
|
|
std::optional< int64_t > |
first_row_id = std::nullopt |
|
) |
| |
|
static |
Factory function to create a writer for a manifest file based on format version.
- Parameters
-
| format_version | The format version (1, 2, 3, etc.). |
| snapshot_id | ID of the snapshot. |
| manifest_location | Path to the manifest file. |
| file_io | File IO implementation to use. |
| partition_spec | Partition spec for the manifest. |
| current_schema | Schema containing the source fields referenced by partition spec. |
| content | Content of the manifest (required for format_version >= 2). |
| first_row_id | First row ID of the snapshot (required for format_version >= 3). |
- Returns
- A Result containing the writer or an error.
◆ metrics()
| Result< Metrics > iceberg::ManifestWriter::metrics |
( |
| ) |
const |
Get the metrics of written manifest file.
- Note
- Only valid after the file is closed.
◆ ToManifestFile()
| Result< ManifestFile > iceberg::ManifestWriter::ToManifestFile |
( |
| ) |
const |
Get the ManifestFile object.
- Note
- Only valid after the file is closed.
◆ WriteAddedEntry()
| Status iceberg::ManifestWriter::WriteAddedEntry |
( |
std::shared_ptr< DataFile > |
file, |
|
|
std::optional< int64_t > |
data_sequence_number = std::nullopt |
|
) |
| |
Add an added entry for a file with a specific sequence number.
- Parameters
-
| file | an added data file |
| data_sequence_number | a data sequence number for the file |
- Returns
- Status indicating success or failure
- Note
- The entry's snapshot ID will be this manifest's snapshot ID. The entry's data sequence number will be the provided data sequence number. The entry's file sequence number will be assigned at commit.
◆ WriteDeletedEntry()
| Status iceberg::ManifestWriter::WriteDeletedEntry |
( |
std::shared_ptr< DataFile > |
file, |
|
|
int64_t |
data_sequence_number, |
|
|
std::optional< int64_t > |
file_sequence_number = std::nullopt |
|
) |
| |
Add a delete entry for a file.
- Parameters
-
| file | a deleted data file |
| data_sequence_number | a data sequence number of the file (assigned when the file was added) |
| file_sequence_number | a file sequence number (assigned when the file was added) |
- Returns
- Status indicating success or failure
- Note
- The entry's snapshot ID will be this manifest's snapshot ID. However, the original data and file sequence numbers of the file must be preserved when the file is marked as deleted.
◆ WriteEntry()
| Status iceberg::ManifestWriter::WriteEntry |
( |
const ManifestEntry & |
entry | ) |
|
Write the entry that all its fields are populated correctly.
- Parameters
-
| entry | Manifest entry to write. |
- Returns
- Status indicating success or failure
- Note
- All other write entry variants delegate to this method after populating the necessary fields.
◆ WriteExistingEntry()
| Status iceberg::ManifestWriter::WriteExistingEntry |
( |
std::shared_ptr< DataFile > |
file, |
|
|
int64_t |
file_snapshot_id, |
|
|
int64_t |
data_sequence_number, |
|
|
std::optional< int64_t > |
file_sequence_number = std::nullopt |
|
) |
| |
Add an existing entry for a file.
- Parameters
-
| file | an existing data file |
| file_snapshot_id | snapshot ID when the data file was added to the table |
| data_sequence_number | a data sequence number of the file (assigned when the file was added) |
| file_sequence_number | a file sequence number (assigned when the file was added) |
- Returns
- Status indicating success or failure
- Note
- The original data and file sequence numbers, snapshot ID, which were assigned at commit, must be preserved when adding an existing entry.
The documentation for this class was generated from the following files: