iceberg-cpp
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
iceberg::SnapshotSummaryBuilder Class Reference

Helper class for building snapshot summaries. More...

#include <snapshot.h>

Public Member Functions

void Clear ()
 Clear all tracked metrics and properties.
 
void SetPartitionSummaryLimit (int32_t max)
 Set the maximum number of changed partitions before partition summaries will be excluded.
 
void IncrementDuplicateDeletes (int32_t increment=1)
 Increment the count of duplicate files deleted by a specific amount.
 
Status AddedFile (const PartitionSpec &spec, const DataFile &file)
 Track a data file being added to the snapshot.
 
Status DeletedFile (const PartitionSpec &spec, const DataFile &file)
 Track a data file being deleted from the snapshot.
 
void AddedManifest (const ManifestFile &manifest)
 Track a manifest being added.
 
void Set (const std::string &property, const std::string &value)
 Set a custom summary property.
 
void Merge (const SnapshotSummaryBuilder &other)
 Merge another builder's metrics into this one.
 
std::unordered_map< std::string, std::string > Build () const
 Build the final summary map.
 

Detailed Description

Helper class for building snapshot summaries.

This class provides methods to track changes to data and delete files, and produces a map of summary properties for snapshot metadata.

Member Function Documentation

◆ AddedFile()

Status iceberg::SnapshotSummaryBuilder::AddedFile ( const PartitionSpec spec,
const DataFile file 
)

Track a data file being added to the snapshot.

Parameters
specThe partition spec
fileThe data file being added
Returns
Status indicating success or error

◆ AddedManifest()

void iceberg::SnapshotSummaryBuilder::AddedManifest ( const ManifestFile manifest)

Track a manifest being added.

Parameters
manifestThe manifest file being added

◆ Build()

std::unordered_map< std::string, std::string > iceberg::SnapshotSummaryBuilder::Build ( ) const

Build the final summary map.

Returns
Map of summary properties

◆ DeletedFile()

Status iceberg::SnapshotSummaryBuilder::DeletedFile ( const PartitionSpec spec,
const DataFile file 
)

Track a data file being deleted from the snapshot.

Parameters
specThe partition spec
fileThe data file being deleted
Returns
Status indicating success or error

◆ IncrementDuplicateDeletes()

void iceberg::SnapshotSummaryBuilder::IncrementDuplicateDeletes ( int32_t  increment = 1)

Increment the count of duplicate files deleted by a specific amount.

Parameters
incrementAmount to increment by. Defaults to 1.

◆ Merge()

void iceberg::SnapshotSummaryBuilder::Merge ( const SnapshotSummaryBuilder other)

Merge another builder's metrics into this one.

Parameters
otherThe builder to merge from

◆ Set()

void iceberg::SnapshotSummaryBuilder::Set ( const std::string &  property,
const std::string &  value 
)

Set a custom summary property.

Parameters
propertyProperty name
valueProperty value

◆ SetPartitionSummaryLimit()

void iceberg::SnapshotSummaryBuilder::SetPartitionSummaryLimit ( int32_t  max)

Set the maximum number of changed partitions before partition summaries will be excluded.

If the number of changed partitions is over this max, summaries will not be included. If the number of changed partitions is <= this limit, then partition-level summaries will be included in the summary if they are available, and "partition-summaries-included" will be set to "true".

Parameters
maxMaximum number of changed partitions

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