See: Description
Interface | Description |
---|---|
RowBatchReader |
Extended version of a record reader used by the revised
scan batch operator.
|
ScanOperatorEvents |
Interface to the set of readers, and reader schema, that the scan operator
manages.
|
Class | Description |
---|---|
ScanOperatorExec |
Implementation of the revised scan operator that uses a mutator aware of
batch sizes.
|
Two versions of the scan operator exist:
ScanBatch
: the original version that uses readers based on the
RecordReader
interface. ScanBatch cannot, however, handle
limited-length vectors.ScanOperatorExec
: the revised version that uses a more modular
design and that offers a mutator that is a bit easier to use, and can limit
vector sizes.Further, the new version is designed to allow intensive unit test without the need for the Drill server. New readers should exploit this feature to include intensive tests to keep Drill quality high.
See ScanOperatorExec
for details of the scan operator protocol
and components.
+------------+ +-----------+
| Scan Batch | +---> | ScanBatch |
| Creator | | +-----------+
+------------+ | |
| | |
v | |
+------------+ | v
| Format | ---+ +---------------+
| Plugin | -----> | Record Reader |
+------------+ +---------------+
The scan batch creator is unique to each storage plugin and is created
based on the physical operator configuration ("pop config"). The
scan batch creator delegates to the format plugin to create both the
scan batch (the scan operator) and the set of readers which the scan
batch will manage.
The scan batch
provides a Mutator
that creates the vectors used by the
record readers. Schema continuity comes from reusing the Mutator from one
file/block to the next.
One characteristic of this system is that all the record readers are created up front. If we must read 1000 blocks, we'll create 1000 record readers. Developers must be very careful to only allocate resources when the reader is opened, and release resources when the reader is closed. Else, resource bloat becomes a large problem.
+------------+ +---------------+
| Scan Batch | -------> | Format Plugin |
| Creator | +---------------+
+------------+ / | \
/ | \
+---------------------+ | \ +---------------+
| OperatorRecordBatch | | +---->| ScanFramework |
+---------------------+ | | +---------------+
v | |
+------------------+ |
| ScanOperatorExec | |
+------------------+ v
| +--------------+
+----------> | Batch Reader |
+--------------+
Here, the scan batch creator again delegates to the format plugin. The
format plugin creates three objects:
OperatorRecordBatch
, which encapsulates the Volcano
iterator protocol. It also holds onto the output batch. This allows the
operator implementation to just focus on its specific job.ScanOperatorExec
is the operator implementation for
the new result-set-loader based scan.A key part of the scan strategy is the batch reader. ("Batch" because it reads an entire batch at a time, using the result set loader.) The framework creates batch readers one by one as needed. Resource bloat is less of an issue because only one batch reader instance exists at any time for each scan operator instance.
Each of the above is further broken down into additional classes to handle projection and so on.
Copyright © 1970 The Apache Software Foundation. All rights reserved.