gravitino.api.stats.supports_statistics.SupportsStatistics

class gravitino.api.stats.supports_statistics.SupportsStatistics

Bases: ABC

SupportsStatistics provides methods to list and update statistics.

A table, a partition or a fileset can implement this interface to manage its statistics.

__init__()

Methods

__init__()

drop_statistics(statistics)

Drop statistics by their names.

list_statistics()

Lists all statistics.

update_statistics(statistics)

Updates statistics with the provided values.

abstract drop_statistics(statistics: list[str]) bool

Drop statistics by their names.

If the statistic is unmodifiable, it will throw an UnmodifiableStatisticException.

Args:

statistics: a list of statistic names to be dropped

Returns:
bool:

True if the statistics were successfully dropped, False if no statistics were dropped

Raises:
UnmodifiableStatisticException:

if any of the statistics to be dropped are unmodifiable

abstract list_statistics() list[gravitino.api.stats.statistic.Statistic]

Lists all statistics.

Returns:

A list of statistics

abstract update_statistics(statistics: dict[str, gravitino.api.stats.statistic_value.StatisticValue[Any]]) None

Updates statistics with the provided values.

If the statistic exists, it will be updated with the new value. If the statistic does not exist, it will be created. If the statistic is unmodifiable, it will throw an UnmodifiableStatisticException. If the statistic name is illegal, it will throw an IllegalStatisticNameException.

Args:

statistics: a map of statistic names to their values

Raises:

IllegalStatisticNameException: If the statistic name is illegal UnmodifiableStatisticException: If the statistic is unmodifiable