public class ExternalSortBatch extends AbstractRecordBatch<ExternalSort>
Data is spilled to disk as a "run". A run consists of one or more (typically many) batches, each of which is itself a sorted run of records.
During the sort/merge phase:
Many complex details are involved in doing the above; the details are explained in the methods of this class.
The memory limit observed by this operator is the lesser of:
#MAX_MERGED_BATCH_SIZE.| Modifier and Type | Class and Description |
|---|---|
static class |
ExternalSortBatch.Metric |
AbstractRecordBatch.BatchStateRecordBatch.IterOutcome| Modifier and Type | Field and Description |
|---|---|
protected static ControlsInjector |
injector |
static String |
INTERRUPTION_AFTER_SETUP |
static String |
INTERRUPTION_AFTER_SORT |
static String |
INTERRUPTION_WHILE_MERGING |
static String |
INTERRUPTION_WHILE_SPILLING |
container, context, oContext, popConfig, state, stats, unionTypeEnabledMAX_BATCH_SIZE| Constructor and Description |
|---|
ExternalSortBatch(ExternalSort popConfig,
FragmentContext context,
RecordBatch incoming) |
| Modifier and Type | Method and Description |
|---|---|
void |
buildSchema()
Called by
AbstractRecordBatch as a fast-path to obtain
the first record batch and setup the schema of this batch in order
to quickly return the schema to the client. |
void |
close()
Extreme paranoia to avoid leaving resources unclosed in the case
of an error.
|
int |
getRecordCount()
Gets the number of records that are within this record.
|
SelectionVector2 |
getSelectionVector2() |
SelectionVector4 |
getSelectionVector4() |
WritableBatch |
getWritableBatch()
Gets a writable version of this batch.
|
RecordBatch.IterOutcome |
innerNext()
Process each request for a batch.
|
protected void |
killIncoming(boolean sendUpstream) |
static void |
releaseBatches(RecordBatch incoming) |
static void |
retainSv4OnNone(RecordBatch incoming)
Workaround for DRILL-5656.
|
getContext, getOutgoingContainer, getPopConfig, getSchema, getValueAccessorById, getValueVectorId, iterator, kill, next, next, nextprotected static final ControlsInjector injector
public static final String INTERRUPTION_AFTER_SORT
public static final String INTERRUPTION_AFTER_SETUP
public static final String INTERRUPTION_WHILE_SPILLING
public static final String INTERRUPTION_WHILE_MERGING
public ExternalSortBatch(ExternalSort popConfig, FragmentContext context, RecordBatch incoming)
public int getRecordCount()
RecordBatchpublic SelectionVector4 getSelectionVector4()
getSelectionVector4 in interface VectorAccessiblegetSelectionVector4 in class AbstractRecordBatch<ExternalSort>public SelectionVector2 getSelectionVector2()
getSelectionVector2 in interface VectorAccessiblegetSelectionVector2 in class AbstractRecordBatch<ExternalSort>public void buildSchema()
AbstractRecordBatch as a fast-path to obtain
the first record batch and setup the schema of this batch in order
to quickly return the schema to the client. Note that this method
fetches the first batch from upstream which will be waiting for
us the first time that innerNext() is called.buildSchema in class AbstractRecordBatch<ExternalSort>public RecordBatch.IterOutcome innerNext()
innerNext in class AbstractRecordBatch<ExternalSort>public WritableBatch getWritableBatch()
RecordBatchgetWritableBatch in interface RecordBatchgetWritableBatch in class AbstractRecordBatch<ExternalSort>protected void killIncoming(boolean sendUpstream)
killIncoming in class AbstractRecordBatch<ExternalSort>public void close()
Some Drill code ends up calling close() two or more times. The code here protects itself from these undesirable semantics.
close in interface AutoCloseableclose in class AbstractRecordBatch<ExternalSort>public static void retainSv4OnNone(RecordBatch incoming)
incoming - the incoming batch for some operator which may
(or may not) be an external sort (or, an external sort wrapped
in a batch iterator validator.)public static void releaseBatches(RecordBatch incoming)
Copyright © 2017 The Apache Software Foundation. All rights reserved.