Class BlockLoaderStoredFieldsFromLeafLoader

java.lang.Object
org.elasticsearch.index.mapper.BlockLoaderStoredFieldsFromLeafLoader
All Implemented Interfaces:
BlockLoader.StoredFields

public class BlockLoaderStoredFieldsFromLeafLoader extends Object implements BlockLoader.StoredFields
  • Constructor Details

  • Method Details

    • advanceTo

      public void advanceTo(int docId)
    • source

      public Source source() throws IOException
      Description copied from interface: BlockLoader.StoredFields
      The _source of the document.
      Specified by:
      source in interface BlockLoader.StoredFields
      Throws:
      IOException
    • id

      public String id() throws IOException
      Specified by:
      id in interface BlockLoader.StoredFields
      Returns:
      the ID for the current document
      Throws:
      IOException
    • routing

      public String routing() throws IOException
      Specified by:
      routing in interface BlockLoader.StoredFields
      Returns:
      the routing path for the current document
      Throws:
      IOException
    • storedFields

      public Map<String,List<Object>> storedFields() throws IOException
      Specified by:
      storedFields in interface BlockLoader.StoredFields
      Returns:
      stored fields for the current document
      Throws:
      IOException
    • loaded

      public boolean loaded()
      Description copied from interface: BlockLoader.StoredFields
      Whether stored fields have already been loaded for the current document. If the stored fields are not loaded yet, the block loader might avoid loading them when not needed.
      Specified by:
      loaded in interface BlockLoader.StoredFields
    • lastSourceBytesSize

      public long lastSourceBytesSize()
      Returns the raw byte size of the last loaded _source. This is useful for estimating the untracked memory overhead from source parsing (parsed Java Strings occupy approximately 2x the raw byte size due to UTF-16 encoding).
    • releaseParsedSource

      public void releaseParsedSource()
      Releases the cached parsed source to allow immediate garbage collection of large String objects created during source parsing. For a 5MB text field, the parsed Java String is ~10MB (UTF-16). Releasing it eagerly prevents accumulation of untracked memory that can cause OOM.