Class MetastoreTableInfo

java.lang.Object
org.apache.drill.metastore.components.tables.MetastoreTableInfo

public class MetastoreTableInfo extends Object
Holds metastore table metadata information, including table information, exists status, last modified time and metastore version.
  • Constructor Details

    • MetastoreTableInfo

      public MetastoreTableInfo(TableInfo tableInfo, Long lastModifiedTime, boolean exists, long metastoreVersion)
  • Method Details

    • of

      public static MetastoreTableInfo of(TableInfo tableInfo, TableMetadataUnit unit, long metastoreVersion)
    • tableInfo

      public TableInfo tableInfo()
    • lastModifiedTime

      public Long lastModifiedTime()
    • isExists

      public boolean isExists()
    • metastoreVersion

      public long metastoreVersion()
    • hasChanged

      public boolean hasChanged(boolean currentExists, Long currentLastModifiedTime)
      Checks if table metadata has changed or not, based on given exists status and last modified time. Checks are done based on the following rules and order:
      • If table did not exist but now does not, return true.
      • If table existed but now does, return true.
      • If both last modified times are null, return false.
      • If one last modified time is null and other is not, return true.
      • If both last modified times are the same, return false.
      • If both last modified times are different, return true.
      Parameters:
      currentExists - current table exists status
      currentLastModifiedTime - current table lat modified time
      Returns:
      true if table metadata has changed, false otherwise
    • hashCode

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

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

      public String toString()
      Overrides:
      toString in class Object