public class TableDefnRegistry extends Object
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 and Description |
|---|
TableDefnRegistry(List<TableDefn> tableDefnExtns,
List<InputSourceDefn> inputSourceDefnExtns,
List<InputFormatDefn> inputFormatDefnExtns,
com.fasterxml.jackson.databind.ObjectMapper jsonMapper) |
TableDefnRegistry(com.fasterxml.jackson.databind.ObjectMapper jsonMapper) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,InputFormatDefn> |
formats() |
InputFormatDefn |
inputFormatDefnFor(String type)
Return input format definition for the given input format type name, or
null if there is no such definition. |
InputSourceDefn |
inputSourceDefnFor(String type)
Return input source definition for the given input source type name, or
null if there is no such definition. |
com.fasterxml.jackson.databind.ObjectMapper |
jsonMapper() |
ResolvedTable |
resolve(TableSpec spec) |
TableDefn |
tableDefnFor(String type) |
public TableDefnRegistry(@Nullable List<TableDefn> tableDefnExtns, @Nullable List<InputSourceDefn> inputSourceDefnExtns, @Nullable List<InputFormatDefn> inputFormatDefnExtns, com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
@Inject public TableDefnRegistry(com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
public com.fasterxml.jackson.databind.ObjectMapper jsonMapper()
public ResolvedTable resolve(TableSpec spec)
public InputSourceDefn inputSourceDefnFor(String type)
null if there is no such definition.public InputFormatDefn inputFormatDefnFor(String type)
null if there is no such definition.public Map<String,InputFormatDefn> formats()
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.