Interface FileDataSourceValidator.FormatConfigKeyResolver
- Enclosing class:
FileDataSourceValidator
public static interface FileDataSourceValidator.FormatConfigKeyResolver
Resolves file-format metadata for dataset CRUD validation. Built from all registered
FormatSpec declarations at startup (see EsqlPlugin).-
Method Summary
Modifier and TypeMethodDescriptionconfigKeysForFormat(String formatName) Returns the set of per-dataset config keys the named format recognises (possibly empty for a known format with no extra keys, e.g.formatForExtension(String extension) Returns the logical format name (e.g.Returns all registered format names (lowercased); used only for the unknown-format error message.Builds a resolver from a format-name → config-keys map and an extension → format-name map.
-
Method Details
-
of
static FileDataSourceValidator.FormatConfigKeyResolver of(Map<String, Set<String>> formatConfigKeys, Map<String, String> formatByExtension) Builds a resolver from a format-name → config-keys map and an extension → format-name map. Captures immutable copies so the result is safe for concurrent reads, and lowercases the lookup arguments so callers need not normalize first.knownFormats()is the config-keys map's key set, so it stays consistent withconfigKeysForFormat(java.lang.String)by construction. This is the implementation used in production (seeEsqlPlugin); tests use it too rather than hand-rolling a stand-in. -
configKeysForFormat
Returns the set of per-dataset config keys the named format recognises (possibly empty for a known format with no extra keys, e.g.orc), ornullif the format name is not registered. -
formatForExtension
Returns the logical format name (e.g."ndjson") registered for the given file extension (leading dot, lowercased), ornullif the extension maps to no known format. -
knownFormats
Returns all registered format names (lowercased); used only for the unknown-format error message.
-