Class RangeReadContext

java.lang.Object
org.elasticsearch.xpack.esql.datasources.spi.RangeReadContext

public final class RangeReadContext extends Object
Context for a single RangeAwareFormatReader.readRange(org.elasticsearch.xpack.esql.datasources.spi.StorageObject, org.elasticsearch.xpack.esql.datasources.spi.RangeReadContext) call. Bundles the per-split parameters and carries an opaque file-level context for cross-split state (e.g. cached parsed footer metadata).
  • Constructor Details

    • RangeReadContext

      public RangeReadContext(List<String> projectedColumns, int batchSize, long rangeStart, long rangeEnd, List<Attribute> resolvedAttributes, ErrorPolicy errorPolicy)
    • RangeReadContext

      public RangeReadContext(List<String> projectedColumns, int batchSize, long rangeStart, long rangeEnd, List<Attribute> resolvedAttributes, ErrorPolicy errorPolicy, @Nullable Consumer<String> informationalWarningSink)
      As the above, plus informationalWarningSink — see informationalWarningSink(). Kept as a separate constructor so the many existing callers (tests, benchmarks) that don't care about relaying warnings off this thread are unaffected.
  • Method Details

    • projectedColumns

      public List<String> projectedColumns()
    • batchSize

      public int batchSize()
    • rangeStart

      public long rangeStart()
    • rangeEnd

      public long rangeEnd()
    • resolvedAttributes

      public List<Attribute> resolvedAttributes()
    • errorPolicy

      public ErrorPolicy errorPolicy()
    • informationalWarningSink

      @Nullable public Consumer<String> informationalWarningSink()
      Optional relay for client-visible lenient-policy warnings (see SkipWarnings) raised while reading this range. null means the reader should fall back to emitting warnings directly via HeaderWarning, which is only correct when the read runs on the request/driver thread. Callers that dispatch readRange to a background thread (e.g. AsyncExternalSourceOperatorFactory) must set this to a sink so the warning is relayed back and re-emitted on the correct thread instead of being silently dropped. See FormatReadContext.informationalWarningSink() for the non-range-read counterpart.
    • fileContext

      @Nullable public Object fileContext()
    • setFileContext

      public void setFileContext(@Nullable Object fileContext)