Utility class for table metadata.
More...
#include <table_metadata.h>
Utility class for table metadata.
◆ DeleteRemovedMetadataFiles()
Delete removed metadata files based on retention policy.
Removes obsolete metadata files that are no longer referenced in the current metadata log, based on the metadata.delete-after-commit.enabled property.
- Parameters
-
| io | The FileIO instance for deleting files |
| base | The previous metadata version |
| metadata | The current metadata containing the updated log |
◆ Read()
| Result< std::unique_ptr< TableMetadata > > iceberg::TableMetadataUtil::Read |
( |
class FileIO & |
io, |
|
|
const std::string & |
location, |
|
|
std::optional< size_t > |
length = std::nullopt |
|
) |
| |
|
static |
Read the table metadata file.
- Parameters
-
| io | The file IO to use to read the table metadata. |
| location | The location of the table metadata file. |
| length | The optional length of the table metadata file. |
- Returns
- The table metadata.
◆ Write() [1/2]
| Status iceberg::TableMetadataUtil::Write |
( |
FileIO & |
io, |
|
|
const std::string & |
location, |
|
|
const TableMetadata & |
metadata |
|
) |
| |
|
static |
Write the table metadata to a file.
- Parameters
-
| io | The file IO to use to write the table metadata. |
| location | The location of the table metadata file. |
| metadata | The table metadata to write. |
◆ Write() [2/2]
| Result< std::string > iceberg::TableMetadataUtil::Write |
( |
FileIO & |
io, |
|
|
const TableMetadata * |
base, |
|
|
const std::string & |
base_metadata_location, |
|
|
TableMetadata & |
metadata |
|
) |
| |
|
static |
Write a new metadata file to storage.
Serializes the table metadata to JSON and writes it to a new metadata file. If no location is specified in the metadata, generates a new file path based on the version number.
- Parameters
-
| io | The FileIO instance for writing files |
| base | The base metadata (can be null for new tables) |
| metadata | The metadata to write, which will be updated with the new location |
- Returns
- The new metadata location
The documentation for this struct was generated from the following files: