Class AsyncExternalSourceOperatorFactory.Builder
java.lang.Object
org.elasticsearch.xpack.esql.datasources.AsyncExternalSourceOperatorFactory.Builder
- Enclosing class:
AsyncExternalSourceOperatorFactory
Fluent builder for
AsyncExternalSourceOperatorFactory. Required parameters are captured
via AsyncExternalSourceOperatorFactory.builder(StorageProvider, FormatReader, StoragePath, List, int, int, Executor).
Optional parameters default to: FormatReader.NO_LIMIT for rowLimit, empty collections
for partition/pushed-expression lists, null for opt-in hooks (sliceQueue,
pushdownSupport, etc.), and 1 for parsingParallelism.-
Method Summary
Modifier and TypeMethodDescriptionbuild()datasetName(String datasetName) Sets the dataset name surfaced to query rows via the_indexmetadata column.deferredExtraction(boolean deferredExtraction) Opt into deferred field extraction: the source emits a syntheticColumnExtractor.ROW_POSITION_COLUMNcolumn in encoded form (extractor id packed with file-local position) and registers aColumnExtractorper opened file.errorPolicy(ErrorPolicy errorPolicy) externalSourceMetrics(ExternalSourceMetrics externalSourceMetrics) Node telemetry sink for object-store read metrics; defaults toExternalSourceMetrics.NOOP.Declared_id.path(the logical name of the data column that supplies each row's_id), ornullwhen the dataset declares nomappings._id.path.lastModifiedMillis(Long lastModifiedMillis) Sets the file last-modified epoch-millis used to materialise_versionon the single-file producer paths.maxConcurrentOpenSegments(int maxConcurrentOpenSegments) maxRecordBytes(int maxRecordBytes) parallelism(int parallelism) parsingParallelism(int parsingParallelism) partitionColumnNames(Set<String> partitionColumnNames) partitionValues(Map<String, Object> partitionValues) producerBlockFactory(BlockFactory producerBlockFactory) Sets theBlockFactoryused byVirtualColumnIteratorwhen materialising constant blocks for virtual partition /_file.*columns.producerExecutor(Executor producerExecutor) Executor for the page consumer (producer loop + drain), distinct from the read/parse executor passed toAsyncExternalSourceOperatorFactory.builder(org.elasticsearch.xpack.esql.datasources.spi.StorageProvider, org.elasticsearch.xpack.esql.datasources.spi.FormatReader, org.elasticsearch.xpack.esql.datasources.spi.StoragePath, java.util.List<org.elasticsearch.xpack.esql.core.expression.Attribute>, int, int, java.util.concurrent.Executor).pushdownSupport(FilterPushdownSupport pushdownSupport) pushedExpressions(List<Expression> pushedExpressions) Declared logical->physical column renames; applied to reader-facing names at the last mile.rowLimit(int rowLimit) schemaMap(Map<StoragePath, SchemaReconciliation.FileSchemaInfo> schemaMap) sliceQueue(ExternalSliceQueue sliceQueue) statsColumnScope(StripeColumnScope statsColumnScope) How much per-stripe statistics a fresh scan harvests (seeExternalSourceCacheSettings#STRIPE_COLUMNSandStripeColumnScope).statsStripeSize(long statsStripeSize) Canonical-stripe grid for per-stripe stats accounting, in decompressed-stream bytes (<= 0disables — the default).streamingSegmentatorAdmission(org.elasticsearch.xpack.esql.datasources.StreamingSegmentatorAdmission streamingSegmentatorAdmission) Node-level gate bounding concurrent streaming segmentators on the sharedesql_external_iopool (seeStreamingSegmentatorAdmission).
-
Method Details
-
producerExecutor
public AsyncExternalSourceOperatorFactory.Builder producerExecutor(@Nullable Executor producerExecutor) Executor for the page consumer (producer loop + drain), distinct from the read/parse executor passed toAsyncExternalSourceOperatorFactory.builder(org.elasticsearch.xpack.esql.datasources.spi.StorageProvider, org.elasticsearch.xpack.esql.datasources.spi.FormatReader, org.elasticsearch.xpack.esql.datasources.spi.StoragePath, java.util.List<org.elasticsearch.xpack.esql.core.expression.Attribute>, int, int, java.util.concurrent.Executor). Production wires this toesql_workerwhile the read/parse executor is theesql_external_iopool, so a full I/O pool of blocked parser workers cannot starve the drain that consumes their pages. When unset (ornull), the consumer shares the read/parse executor — the prior single-pool behavior, retained for tests and callers that pass one executor. -
rowLimit
-
fileList
-
schemaMap
public AsyncExternalSourceOperatorFactory.Builder schemaMap(@Nullable Map<StoragePath, SchemaReconciliation.FileSchemaInfo> schemaMap) -
partitionColumnNames
public AsyncExternalSourceOperatorFactory.Builder partitionColumnNames(@Nullable Set<String> partitionColumnNames) -
partitionValues
public AsyncExternalSourceOperatorFactory.Builder partitionValues(@Nullable Map<String, Object> partitionValues) -
datasetName
Sets the dataset name surfaced to query rows via the_indexmetadata column.nullwhen theFROMdid not resolve to a single registered dataset (e.g. bare-globFROM "s3://bucket/*.parquet"); the_indexcolumn then renders as SQLNULL. Only consulted when the bound attributes include anExternalMetadataAttributenamed_index. -
renames
Declared logical->physical column renames; applied to reader-facing names at the last mile. -
idPath
Declared_id.path(the logical name of the data column that supplies each row's_id), ornullwhen the dataset declares nomappings._id.path. When set,VirtualColumnIteratorstamps_idfrom that column instead of the synthetic (file+row-position) identity. -
lastModifiedMillis
public AsyncExternalSourceOperatorFactory.Builder lastModifiedMillis(@Nullable Long lastModifiedMillis) Sets the file last-modified epoch-millis used to materialise_versionon the single-file producer paths.null(the default) leaves_versionas SQLNULLon those paths. Only consulted when the source has no per-file mtime source — the slice-queue path reads_file.modifiedout of theFileSplit's partition values, and the multi-file path reads it off theFileListentry; both ignore this builder value. -
producerBlockFactory
public AsyncExternalSourceOperatorFactory.Builder producerBlockFactory(@Nullable BlockFactory producerBlockFactory) Sets theBlockFactoryused byVirtualColumnIteratorwhen materialising constant blocks for virtual partition /_file.*columns. Production should pass the node-level (root) factory so producer-thread allocations route through the global request circuit breaker rather than the driver-local breaker (which asserts single-thread access during the driver's run loop). Tests may leave thisnullto fall back to the driver context's factory. -
sliceQueue
public AsyncExternalSourceOperatorFactory.Builder sliceQueue(@Nullable ExternalSliceQueue sliceQueue) -
errorPolicy
-
parsingParallelism
-
maxConcurrentOpenSegments
public AsyncExternalSourceOperatorFactory.Builder maxConcurrentOpenSegments(int maxConcurrentOpenSegments) -
maxRecordBytes
-
statsStripeSize
Canonical-stripe grid for per-stripe stats accounting, in decompressed-stream bytes (<= 0disables — the default). SeeExternalSourceCacheSettings#STRIPE_SIZEandStreamingParallelParsingCoordinator; stats-accounting overlay only, never a partitioning or scheduling input. -
statsColumnScope
public AsyncExternalSourceOperatorFactory.Builder statsColumnScope(@Nullable StripeColumnScope statsColumnScope) How much per-stripe statistics a fresh scan harvests (seeExternalSourceCacheSettings#STRIPE_COLUMNSandStripeColumnScope).nullrestores theStripeColumnScope.PROJECTEDdefault. Orthogonal tostatsStripeSize. -
pushedExpressions
public AsyncExternalSourceOperatorFactory.Builder pushedExpressions(@Nullable List<Expression> pushedExpressions) -
pushdownSupport
public AsyncExternalSourceOperatorFactory.Builder pushdownSupport(@Nullable FilterPushdownSupport pushdownSupport) -
onClose
- Parameters:
onClose- lifecycle callback owned by this factory, invoked exactly once when the last operator created byAsyncExternalSourceOperatorFactory.get(org.elasticsearch.compute.operator.DriverContext)completes (ref count drops to zero). Used by the per-source concurrency budget to deregister from the allocator. May benullwhen no per-source cleanup is needed. Callers must ensure thatget()is called at least once; otherwise the callback never fires and the resource it guards leaks.
-
parallelism
-
deferredExtraction
Opt into deferred field extraction: the source emits a syntheticColumnExtractor.ROW_POSITION_COLUMNcolumn in encoded form (extractor id packed with file-local position) and registers aColumnExtractorper opened file. The caller (typicallyInsertExternalFieldExtractionviaLocalExecutionPlanner) pairs this with anExternalFieldExtractOperatorthat resolves the extractor by id and materializes the deferred columns post-TopN.The configured
FormatReadermust implementColumnExtractorAware— verified atbuild()time. -
externalSourceMetrics
public AsyncExternalSourceOperatorFactory.Builder externalSourceMetrics(ExternalSourceMetrics externalSourceMetrics) Node telemetry sink for object-store read metrics; defaults toExternalSourceMetrics.NOOP. -
streamingSegmentatorAdmission
public AsyncExternalSourceOperatorFactory.Builder streamingSegmentatorAdmission(org.elasticsearch.xpack.esql.datasources.StreamingSegmentatorAdmission streamingSegmentatorAdmission) Node-level gate bounding concurrent streaming segmentators on the sharedesql_external_iopool (seeStreamingSegmentatorAdmission). Set byFileSourceFactoryfrom node settings; when unset the builder keeps itsStreamingSegmentatorAdmission.unbounded()default. -
build
-