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 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 with configKeysForFormat(java.lang.String) by construction. This is the implementation used in production (see EsqlPlugin); tests use it too rather than hand-rolling a stand-in.
    • configKeysForFormat

      @Nullable Set<String> configKeysForFormat(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. orc), or null if the format name is not registered.
    • formatForExtension

      @Nullable String formatForExtension(String extension)
      Returns the logical format name (e.g. "ndjson") registered for the given file extension (leading dot, lowercased), or null if the extension maps to no known format.
    • knownFormats

      Set<String> knownFormats()
      Returns all registered format names (lowercased); used only for the unknown-format error message.