Class InputTextReader

java.lang.Object
org.elasticsearch.xpack.esql.inference.InputTextReader
All Implemented Interfaces:
Closeable, AutoCloseable, org.elasticsearch.core.Releasable

public class InputTextReader extends Object implements org.elasticsearch.core.Releasable
Helper class that reads text strings from a BytesRefBlock. This class is used by inference operators to extract text content from block data.
  • Constructor Details

    • InputTextReader

      public InputTextReader(BytesRefBlock textBlock)
  • Method Details

    • readText

      public String readText(int pos)
      Reads the text string at the given position. Multiple values at the position are concatenated with newlines.
      Parameters:
      pos - the position index in the block
      Returns:
      the text string at the position, or null if the position contains a null value
    • readText

      public String readText(int pos, int limit)
      Reads the text string at the given position.
      Parameters:
      pos - the position index in the block
      limit - the maximum number of value to read from the position
      Returns:
      the text string at the position, or null if the position contains a null value
    • estimatedSize

      public int estimatedSize()
      Returns the total number of positions (text entries) in the block.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface org.elasticsearch.core.Releasable