Package org.apache.druid.catalog.model
Class TableMetadata
- java.lang.Object
-
- org.apache.druid.catalog.model.TableMetadata
-
public class TableMetadata extends Object
REST API level description of a table. Tables have multiple types as described by subclasses. Stores the operational aspects of a table, such as its name, creation time, state and spec.Doubles as a "holder" of partial collections of table metadata internally. For example, in the "edit" operation, the id and a partial spec will be available, the other fields are implicitly unset. The set of provided fields is implicit in the code that uses the object. (Providing partial information avoids the need to query the DB for information that won't actually be used.)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTableMetadata.TableStateState of the metadata table entry (not necessarily of the underlying datasource.) A table entry will be Active normally.
-
Constructor Summary
Constructors Constructor Description TableMetadata(TableId tableId, long creationTime, long updateTime, TableMetadata.TableState state, TableSpec spec)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TableMetadataasUpdate(long updateTime)longcreationTime()static TableMetadataempty(TableId id)booleanequals(Object o)static TableMetadataforUpdate(TableId id, long updateTime, TableSpec spec)TableMetadatafromInsert(long updateTime)inthashCode()TableIdid()static TableMetadatanewTable(TableId id, TableSpec spec)static TableMetadataof(TableId id, TableSpec spec)TableSpecspec()StringsqlName()TableMetadata.TableStatestate()StringtoString()longupdateTime()voidvalidate()Syntactic validation of a table object.TableMetadatawithColumns(TableMetadata update)TableMetadatawithProperties(Map<String,Object> props)TableMetadatawithProperties(TableMetadata update)TableMetadatawithSpec(TableSpec spec)
-
-
-
Constructor Detail
-
TableMetadata
public TableMetadata(TableId tableId, long creationTime, long updateTime, TableMetadata.TableState state, TableSpec spec)
-
-
Method Detail
-
newTable
public static TableMetadata newTable(TableId id, TableSpec spec)
-
of
public static TableMetadata of(TableId id, TableSpec spec)
-
forUpdate
public static TableMetadata forUpdate(TableId id, long updateTime, TableSpec spec)
-
empty
public static TableMetadata empty(TableId id)
-
fromInsert
public TableMetadata fromInsert(long updateTime)
-
asUpdate
public TableMetadata asUpdate(long updateTime)
-
withSpec
public TableMetadata withSpec(TableSpec spec)
-
withColumns
public TableMetadata withColumns(TableMetadata update)
-
withProperties
public TableMetadata withProperties(TableMetadata update)
-
withProperties
public TableMetadata withProperties(Map<String,Object> props)
-
id
public TableId id()
-
sqlName
public String sqlName()
-
state
public TableMetadata.TableState state()
-
creationTime
public long creationTime()
-
updateTime
public long updateTime()
-
spec
public TableSpec spec()
-
validate
public void validate()
Syntactic validation of a table object. Validates only that which can be checked from this table object.
-
-