gravitino.client.metadata_object_statistics_operations.MetadataObjectStatisticsOperations¶
- class gravitino.client.metadata_object_statistics_operations.MetadataObjectStatisticsOperations(metalake_name: str, metadata_object: MetadataObject, rest_client: HTTPClient)¶
Bases:
SupportsStatisticsThe implementation of SupportsStatistics.
This interface will be composited into table to provide statistics operations for metadata objects.
- __init__(metalake_name: str, metadata_object: MetadataObject, rest_client: HTTPClient)¶
Methods
__init__(metalake_name, metadata_object, ...)drop_statistics(statistics)Drop statistics by their names.
Lists all statistics.
update_statistics(statistics)Updates statistics with the provided values.
- 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
- list_statistics() list[gravitino.api.stats.statistic.Statistic]¶
Lists all statistics.
- Returns:
A list of statistics
- 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