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

Factory class for creating and managing MetricsReporter instances. More...

#include <metrics_reporters.h>

Static Public Member Functions

static Result< std::unique_ptr< MetricsReporter > > Load (const std::unordered_map< std::string, std::string > &properties)
 Load a metrics reporter based on properties.
 
static Status Register (std::string_view reporter_type, MetricsReporterFactory factory)
 Register a factory for a metrics reporter type.
 
static std::shared_ptr< MetricsReporterCombine (std::shared_ptr< MetricsReporter > first, std::shared_ptr< MetricsReporter > second)
 Combine two reporters into one.
 

Detailed Description

Factory class for creating and managing MetricsReporter instances.

This class provides a registry-based factory for creating MetricsReporter implementations. Custom reporter implementations can be registered using the Register() method.

Member Function Documentation

◆ Combine()

std::shared_ptr< MetricsReporter > iceberg::MetricsReporters::Combine ( std::shared_ptr< MetricsReporter first,
std::shared_ptr< MetricsReporter second 
)
static

Combine two reporters into one.

Parameters
firstFirst reporter, may be nullptr.
secondSecond reporter, may be nullptr.
Returns
Combined reporter, or nullptr if both inputs are nullptr.

◆ Load()

Result< std::unique_ptr< MetricsReporter > > iceberg::MetricsReporters::Load ( const std::unordered_map< std::string, std::string > &  properties)
static

Load a metrics reporter based on properties.

This method looks up the "metrics-reporter-impl" property to determine which reporter implementation to create. If not specified, returns a NoopMetricsReporter.

Parameters
propertiesConfiguration properties containing reporter type.
Returns
A new MetricsReporter instance or an error.

◆ Register()

Status iceberg::MetricsReporters::Register ( std::string_view  reporter_type,
MetricsReporterFactory  factory 
)
static

Register a factory for a metrics reporter type.

Thread-safe. Registrations can be performed at any time, including concurrently with Load().

Parameters
reporter_typeType identifier matched case-sensitively against the value of "metrics-reporter-impl" in catalog properties, mirroring Java's fully-qualified class-name lookup (e.g., "noop").
factoryFactory function that produces the reporter.
Returns
OK if the registration succeeded, or an error if the factory is invalid.

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