Class MetastoreTableInfo
java.lang.Object
org.apache.drill.metastore.components.tables.MetastoreTableInfo
Holds metastore table metadata information, including table information, exists status,
last modified time and metastore version.
-
Constructor Summary
ConstructorDescriptionMetastoreTableInfo
(TableInfo tableInfo, Long lastModifiedTime, boolean exists, long metastoreVersion) -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
hasChanged
(boolean currentExists, Long currentLastModifiedTime) Checks if table metadata has changed or not, based on given exists status and last modified time.int
hashCode()
boolean
isExists()
long
static MetastoreTableInfo
of
(TableInfo tableInfo, TableMetadataUnit unit, long metastoreVersion) toString()
-
Constructor Details
-
MetastoreTableInfo
-
-
Method Details
-
of
public static MetastoreTableInfo of(TableInfo tableInfo, TableMetadataUnit unit, long metastoreVersion) -
tableInfo
-
lastModifiedTime
-
isExists
public boolean isExists() -
metastoreVersion
public long metastoreVersion() -
hasChanged
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 statuscurrentLastModifiedTime
- current table lat modified time- Returns:
- true if table metadata has changed, false otherwise
-
hashCode
public int hashCode() -
equals
-
toString
-