Package org.apache.druid.catalog.model
Class TableDefnRegistry
- java.lang.Object
-
- org.apache.druid.catalog.model.TableDefnRegistry
-
public class TableDefnRegistry extends Object
Registry of the table types supported in the catalog. This registry is used to validate insertions and updates. A table spec has a type field. That spec is said to be "resolved" when we use that type field to look up the definition for that type, and combine them into aResolvedTable.Note an inherent race condition: once a record is written into the metadata DB, that record has a life independent of what happens in this table. It may be that a catalog entry is created for a table type defined in an extension. Later, that extension is removed. The system must still work with the now "unknown" table types in the DB. But, we won't allow the use of, changes to, or new instances of that type. The choice is to delete the now undefined table, or restore the extension.
Holds onto the JSON mapper to simplify the resolution process: the
ResolvedTableprovides the mapper used to serialize the table spec.
-
-
Constructor Summary
Constructors Constructor Description TableDefnRegistry(com.fasterxml.jackson.databind.ObjectMapper jsonMapper)TableDefnRegistry(List<TableDefn> tableDefnExtns, List<InputSourceDefn> inputSourceDefnExtns, List<InputFormatDefn> inputFormatDefnExtns, com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,InputFormatDefn>formats()InputFormatDefninputFormatDefnFor(String type)Return input format definition for the given input format type name, ornullif there is no such definition.InputSourceDefninputSourceDefnFor(String type)Return input source definition for the given input source type name, ornullif there is no such definition.com.fasterxml.jackson.databind.ObjectMapperjsonMapper()ResolvedTableresolve(TableSpec spec)TableDefntableDefnFor(String type)
-
-
-
Constructor Detail
-
TableDefnRegistry
public TableDefnRegistry(@Nullable List<TableDefn> tableDefnExtns, @Nullable List<InputSourceDefn> inputSourceDefnExtns, @Nullable List<InputFormatDefn> inputFormatDefnExtns, com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
-
TableDefnRegistry
@Inject public TableDefnRegistry(com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
-
-
Method Detail
-
jsonMapper
public com.fasterxml.jackson.databind.ObjectMapper jsonMapper()
-
resolve
public ResolvedTable resolve(TableSpec spec)
-
inputSourceDefnFor
public InputSourceDefn inputSourceDefnFor(String type)
Return input source definition for the given input source type name, ornullif there is no such definition.
-
inputFormatDefnFor
public InputFormatDefn inputFormatDefnFor(String type)
Return input format definition for the given input format type name, ornullif there is no such definition.
-
formats
public Map<String,InputFormatDefn> formats()
-
-