Interface ColumnExtractorProducer
- All Known Implementing Classes:
StatsCapturingIterator
ColumnExtractor.ROW_POSITION_COLUMN alongside their pages and can produce a matching
ColumnExtractor whose addressing space is identical to the one the iterator is using
for its row-position counter.
Implementing this interface is mandatory for any reader iterator on the deferred-extraction
path: opting in commits to the full handshake — the iterator both produces a matching
extractor and emits _rowPosition values already encoded with the registry-
assigned id, so downstream operators can decode them without an intermediate re-encoding
pass. Iterators that don't support deferred extraction simply omit
ColumnExtractorAware on the format reader and never reach this code path.
Encoding handshake
- The factory wraps the iterator's pages and calls
createColumnExtractor()to build a matchingColumnExtractor. - The factory registers the extractor with
SourceExtractors, receiving an id. - The factory calls
setExtractorId(int)before draining the first page, handing the iterator the id it must OR into every_rowPositionvalue it emits. - From then on, every page the iterator returns carries pre-encoded
_rowPositionvalues of the form(id << 48) | physicalRowOffset— seeSourceExtractorsfor the bit layout.
_rowPosition block per page (the iterator
already has the values in a primitive long[] buffer) and removes a per-page page-rebuild
step from the producer thread.
Implementations should construct the extractor lazily — typically on the first call to
createColumnExtractor() — and may return the same instance on subsequent calls.
Lifetime is owned by the caller via SourceExtractors (the registry calls
Releasable.close() when the driver finishes).
-
Method Summary
Modifier and TypeMethodDescriptionCreates theColumnExtractormatching this iterator's addressing space.voidsetExtractorId(int id) Hands the iterator theSourceExtractors-assigned id under which its matchingColumnExtractoris registered.
-
Method Details
-
createColumnExtractor
Creates theColumnExtractormatching this iterator's addressing space.The iterator must already be positioned to emit pages with
ColumnExtractor.ROW_POSITION_COLUMNbefore this is called; implementations may capture iterator-internal state (such as a range-restricted footer) at construction time.- Throws:
IOException
-
setExtractorId
void setExtractorId(int id) Hands the iterator theSourceExtractors-assigned id under which its matchingColumnExtractoris registered. Must be called once, aftercreateColumnExtractor()and before the first page is drained. Every subsequent page the iterator emits must carry_rowPositionvalues already encoded with this id (typically by OR-ing((long) id << 48)into each value as it is materialised).Calling this method twice on the same iterator, or skipping it on the deferred path, is a programmer error: the iterator's pages either carry mismatched ids or unencoded raw row offsets that the lookup registry cannot route.
- Parameters:
id- registry-assigned extractor id; must be in[0, MAX_EXTRACTOR_ID](seeSourceExtractors)
-