Package org.apache.druid.catalog.model
Class TableDefnRegistry
java.lang.Object
org.apache.druid.catalog.model.TableDefnRegistry
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 a
ResolvedTable.
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
ResolvedTable provides the mapper used to serialize the table spec.
-
Constructor Summary
ConstructorsConstructorDescriptionTableDefnRegistry(com.fasterxml.jackson.databind.ObjectMapper jsonMapper) TableDefnRegistry(List<TableDefn> tableDefnExtns, List<InputSourceDefn> inputSourceDefnExtns, List<InputFormatDefn> inputFormatDefnExtns, com.fasterxml.jackson.databind.ObjectMapper jsonMapper) -
Method Summary
Modifier and TypeMethodDescriptionformats()inputFormatDefnFor(String type) Return input format definition for the given input format type name, ornullif there is no such definition.inputSourceDefnFor(String type) Return input source definition for the given input source type name, ornullif there is no such definition.com.fasterxml.jackson.databind.ObjectMappertableDefnFor(String type)
-
Constructor Details
-
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 Details
-
tableDefnFor
-
jsonMapper
public com.fasterxml.jackson.databind.ObjectMapper jsonMapper() -
resolve
-
inputSourceDefnFor
Return input source definition for the given input source type name, ornullif there is no such definition. -
inputFormatDefnFor
Return input format definition for the given input format type name, ornullif there is no such definition. -
formats
-