Class BaseMetadata

java.lang.Object
org.apache.drill.metastore.metadata.BaseMetadata
All Implemented Interfaces:
Metadata
Direct Known Subclasses:
BaseTableMetadata, FileMetadata, PartitionMetadata, RowGroupMetadata, SegmentMetadata

public abstract class BaseMetadata extends Object implements Metadata
Common provider of tuple schema, column metadata, and statistics for table, partition, file or row group.
  • Field Details

  • Constructor Details

  • Method Details

    • getColumnsStatistics

      public Map<SchemaPath,ColumnStatistics<?>> getColumnsStatistics()
      Description copied from interface: Metadata
      Returns statistics stored in current metadata represented as Map of column SchemaPaths and corresponding ColumnStatistics.
      Specified by:
      getColumnsStatistics in interface Metadata
      Returns:
      statistics stored in current metadata
    • getColumnStatistics

      public ColumnStatistics<?> getColumnStatistics(SchemaPath columnName)
      Description copied from interface: Metadata
      Returns statistics for specified column stored in current metadata.
      Specified by:
      getColumnStatistics in interface Metadata
      Parameters:
      columnName - column whose statistics should be returned
      Returns:
      statistics for specified column
    • getSchema

      public TupleMetadata getSchema()
      Description copied from interface: Metadata
      Returns schema stored in current metadata represented as TupleMetadata.
      Specified by:
      getSchema in interface Metadata
      Returns:
      schema stored in current metadata
    • getStatistic

      public <V> V getStatistic(StatisticsKind<V> statisticsKind)
      Description copied from interface: Metadata
      Returns value of non-column statistics which corresponds to specified StatisticsKind.
      Specified by:
      getStatistic in interface Metadata
      Parameters:
      statisticsKind - statistics kind whose value should be returned
      Returns:
      value of non-column statistics
    • containsExactStatistics

      public boolean containsExactStatistics(StatisticsKind<?> statisticsKind)
      Description copied from interface: Metadata
      Checks whether specified statistics kind is set in this non-column statistics and it corresponds to the exact statistics value.
      Specified by:
      containsExactStatistics in interface Metadata
      Parameters:
      statisticsKind - statistics kind to check
      Returns:
      true if value which corresponds to the specified statistics kind is exact
    • getStatisticsForColumn

      public <V> V getStatisticsForColumn(SchemaPath columnName, StatisticsKind<V> statisticsKind)
      Description copied from interface: Metadata
      Returns value of column statistics which corresponds to specified StatisticsKind for column with specified columnName.
      Specified by:
      getStatisticsForColumn in interface Metadata
      Parameters:
      columnName - name of the column
      statisticsKind - statistics kind whose value should be returned
      Returns:
      value of column statistics
    • getColumn

      public ColumnMetadata getColumn(SchemaPath name)
      Description copied from interface: Metadata
      Returns metadata description for the specified column
      Specified by:
      getColumn in interface Metadata
      Parameters:
      name - column name, whose metadata type info should be returned
      Returns:
      ColumnMetadata schema description of the column
    • getTableInfo

      public TableInfo getTableInfo()
      Specified by:
      getTableInfo in interface Metadata
    • getMetadataInfo

      public MetadataInfo getMetadataInfo()
      Specified by:
      getMetadataInfo in interface Metadata
    • getLastModifiedTime

      public long getLastModifiedTime()
      Allows to check the time, when any files were modified. It is in Unix Timestamp, unit of measurement is millisecond. Undefined time value will be indicated using UNDEFINED_TIME value.
      Returns:
      last modified time of files
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toMetadataUnit

      public TableMetadataUnit toMetadataUnit()
      Description copied from interface: Metadata
      Converts Metadata implementation into TableMetadataUnit instance which will be used to write data into Drill Metastore Tables.
      Specified by:
      toMetadataUnit in interface Metadata
      Returns:
      metadata unit instance
    • toMetadataUnitBuilder

      protected abstract void toMetadataUnitBuilder(TableMetadataUnit.Builder builder)
    • toBuilder

      protected abstract BaseMetadata.BaseMetadataBuilder<?> toBuilder()