Class StatisticDTO

java.lang.Object
org.apache.gravitino.dto.stats.StatisticDTO
All Implemented Interfaces:
Auditable, Statistic

public class StatisticDTO extends Object implements Statistic
Data Transfer Object (DTO) for representing a statistic.
  • Constructor Details

    • StatisticDTO

      public StatisticDTO()
  • Method Details

    • name

      public String name()
      Description copied from interface: Statistic
      Get the name of the statistic.
      Specified by:
      name in interface Statistic
      Returns:
      The name of the statistic.
    • value

      public Optional<StatisticValue<?>> value()
      Description copied from interface: Statistic
      Get the value of the statistic. The value is optional. If the statistic is not set, the value will be empty.
      Specified by:
      value in interface Statistic
      Returns:
      An optional containing the value of the statistic if it is set, otherwise empty.
    • reserved

      public boolean reserved()
      Description copied from interface: Statistic
      The statistic is predefined by Gravitino if the value is true. The statistic is defined by users if the value is false. For example, the statistic "row_count" is a reserved statistic, A custom statistic name must start with "custom." prefix to avoid name conflict with reserved statistics. Because Gravitino may add more reserved statistics in the future.
      Specified by:
      reserved in interface Statistic
      Returns:
      The type of the statistic.
    • modifiable

      public boolean modifiable()
      Description copied from interface: Statistic
      Whether the statistic is modifiable.
      Specified by:
      modifiable in interface Statistic
      Returns:
      If the statistic is modifiable, return true, otherwise false.
    • validate

      public void validate()
      Validates the StatisticDTO.
      Throws:
      IllegalArgumentException - if any of the required fields are invalid.
    • auditInfo

      public AuditDTO auditInfo()
      Specified by:
      auditInfo in interface Auditable
      Returns:
      The audit information of the entity.
    • builder

      public static StatisticDTO.Builder builder()
      Creates a new builder for constructing instances of StatisticDTO.
      Returns:
      a new instance of StatisticDTO.Builder