Record Class MetricsReportEnvelope

java.lang.Object
java.lang.Record
org.apache.polaris.service.metrics.MetricsReportEnvelope
Record Components:
catalogName - the name of the catalog containing the table
catalogId - the internal Polaris ID of the catalog
table - the identifier of the table the metrics are for
tableId - the internal Polaris ID of the table entity
metricType - the kind of metrics report (MetricType.SCAN or MetricType.COMMIT)
report - the Iceberg metrics report (ScanReport or CommitReport)
receivedTimestamp - the timestamp when the metrics were received by Polaris

@Beta public record MetricsReportEnvelope(@NonNull String catalogName, long catalogId, @NonNull org.apache.iceberg.catalog.TableIdentifier table, long tableId, @NonNull MetricType metricType, @NonNull org.apache.iceberg.metrics.MetricsReport report, @NonNull Instant receivedTimestamp) extends Record
Stable, self-describing carrier for an Iceberg metrics report received by Polaris.

Bundles the resolved table context (catalog name/id and table name/id) with the raw Iceberg MetricsReport and an explicit MetricType discriminator, plus the timestamp when the metrics were received. Passing an envelope keeps the IcebergMetricsReporter SPI signature stable as new context fields are added, and lets implementations branch on metricType() without inspecting the concrete Iceberg report type.

  • Constructor Summary

    Constructors
    Constructor
    Description
    MetricsReportEnvelope(@NonNull String catalogName, long catalogId, @NonNull org.apache.iceberg.catalog.TableIdentifier table, long tableId, @NonNull MetricType metricType, @NonNull org.apache.iceberg.metrics.MetricsReport report, @NonNull Instant receivedTimestamp)
    Creates an instance of a MetricsReportEnvelope record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the value of the catalogId record component.
    @NonNull String
    Returns the value of the catalogName record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @NonNull MetricType
    Returns the value of the metricType record component.
    @NonNull Instant
    Returns the value of the receivedTimestamp record component.
    @NonNull org.apache.iceberg.metrics.MetricsReport
    Returns the value of the report record component.
    @NonNull org.apache.iceberg.catalog.TableIdentifier
    Returns the value of the table record component.
    long
    Returns the value of the tableId record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MetricsReportEnvelope

      public MetricsReportEnvelope(@NonNull String catalogName, long catalogId, @NonNull org.apache.iceberg.catalog.TableIdentifier table, long tableId, @NonNull MetricType metricType, @NonNull org.apache.iceberg.metrics.MetricsReport report, @NonNull Instant receivedTimestamp)
      Creates an instance of a MetricsReportEnvelope record class.
      Parameters:
      catalogName - the value for the catalogName record component
      catalogId - the value for the catalogId record component
      table - the value for the table record component
      tableId - the value for the tableId record component
      metricType - the value for the metricType record component
      report - the value for the report record component
      receivedTimestamp - the value for the receivedTimestamp record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • catalogName

      public @NonNull String catalogName()
      Returns the value of the catalogName record component.
      Returns:
      the value of the catalogName record component
    • catalogId

      public long catalogId()
      Returns the value of the catalogId record component.
      Returns:
      the value of the catalogId record component
    • table

      public @NonNull org.apache.iceberg.catalog.TableIdentifier table()
      Returns the value of the table record component.
      Returns:
      the value of the table record component
    • tableId

      public long tableId()
      Returns the value of the tableId record component.
      Returns:
      the value of the tableId record component
    • metricType

      public @NonNull MetricType metricType()
      Returns the value of the metricType record component.
      Returns:
      the value of the metricType record component
    • report

      public @NonNull org.apache.iceberg.metrics.MetricsReport report()
      Returns the value of the report record component.
      Returns:
      the value of the report record component
    • receivedTimestamp

      public @NonNull Instant receivedTimestamp()
      Returns the value of the receivedTimestamp record component.
      Returns:
      the value of the receivedTimestamp record component