Class FormatReaderRegistry

java.lang.Object
org.elasticsearch.xpack.esql.datasources.FormatReaderRegistry

public class FormatReaderRegistry extends Object
Registry for FormatReader implementations, keyed by format name and file extension. Readers are created lazily on first access to avoid pulling in heavy dependencies at startup. Supports compound extensions (e.g. .csv.gz) via DecompressionCodecRegistry.
  • Constructor Details

  • Method Details

    • registerLazy

      public void registerLazy(String formatName, FormatReaderFactory factory, Settings settings, BlockFactory blockFactory)
    • unregister

      public Supplier<FormatReader> unregister(String formatName)
    • byName

      public FormatReader byName(String formatName)
    • findByName

      public FormatReader findByName(String formatName)
      Look up a format reader by name, returning null if not registered. Use for speculative lookups where a missing format is normal (e.g., optimizer probing).
    • registerExtension

      public void registerExtension(String extension, String formatName)
    • byExtension

      public FormatReader byExtension(String objectName)
    • hasCompressedExtension

      public boolean hasCompressedExtension(String objectName)
      Returns true if the object name has a compound extension (e.g. .csv.gz) that is supported: the last extension is a known compression extension and the stripped path has a format.
    • hasFormat

      public boolean hasFormat(String formatName)
    • hasExtension

      public boolean hasExtension(String extension)