Module org.elasticsearch.server
Package org.elasticsearch.index.mapper
Class BlockLoaderStoredFieldsFromLeafLoader
java.lang.Object
org.elasticsearch.index.mapper.BlockLoaderStoredFieldsFromLeafLoader
- All Implemented Interfaces:
BlockLoader.StoredFields
public class BlockLoaderStoredFieldsFromLeafLoader
extends Object
implements BlockLoader.StoredFields
-
Constructor Summary
ConstructorsConstructorDescriptionBlockLoaderStoredFieldsFromLeafLoader(LeafStoredFieldLoader loader, SourceLoader.Leaf sourceLoader) -
Method Summary
Modifier and TypeMethodDescriptionvoidadvanceTo(int docId) id()longReturns the raw byte size of the last loaded _source.booleanloaded()Whether stored fields have already been loaded for the current document.voidReleases the cached parsed source to allow immediate garbage collection of large String objects created during source parsing.routing()source()The_sourceof the document.
-
Constructor Details
-
BlockLoaderStoredFieldsFromLeafLoader
public BlockLoaderStoredFieldsFromLeafLoader(LeafStoredFieldLoader loader, SourceLoader.Leaf sourceLoader)
-
-
Method Details
-
advanceTo
public void advanceTo(int docId) -
source
Description copied from interface:BlockLoader.StoredFieldsThe_sourceof the document.- Specified by:
sourcein interfaceBlockLoader.StoredFields- Throws:
IOException
-
id
- Specified by:
idin interfaceBlockLoader.StoredFields- Returns:
- the ID for the current document
- Throws:
IOException
-
routing
- Specified by:
routingin interfaceBlockLoader.StoredFields- Returns:
- the routing path for the current document
- Throws:
IOException
-
storedFields
- Specified by:
storedFieldsin interfaceBlockLoader.StoredFields- Returns:
- stored fields for the current document
- Throws:
IOException
-
loaded
public boolean loaded()Description copied from interface:BlockLoader.StoredFieldsWhether 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:
loadedin interfaceBlockLoader.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.
-