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:
Modifier and Type | Class and Description |
---|---|
static class |
ExternalSortBatch.Metric |
AbstractRecordBatch.BatchState
RecordBatch.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 |
batchStatsContext, container, context, oContext, popConfig, state, stats, unionTypeEnabled
MAX_BATCH_ROW_COUNT
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. |
protected void |
cancelIncoming() |
void |
close()
Extreme paranoia to avoid leaving resources unclosed in the case
of an error.
|
void |
dump()
Perform dump of this batch's state to logs.
|
int |
getRecordCount()
Get the number of records.
|
SelectionVector2 |
getSelectionVector2() |
SelectionVector4 |
getSelectionVector4()
Returns outputSV4 instead of resultsIterator sv4.
|
WritableBatch |
getWritableBatch()
Gets a writable version of this batch.
|
RecordBatch.IterOutcome |
innerNext()
Process each request for a batch.
|
static void |
releaseBatches(RecordBatch incoming) |
static void |
retainSv4OnNone(RecordBatch incoming)
Workaround for DRILL-5656.
|
cancel, checkContinue, getContainer, getContext, getOutgoingContainer, getPopConfig, getRecordBatchStatsContext, getSchema, getValueAccessorById, getValueVectorId, isRecordBatchStatsLoggingEnabled, iterator, next, next, next, schemaChangeException, schemaChangeException
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
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
protected static final ControlsInjector injector
public ExternalSortBatch(ExternalSort popConfig, FragmentContext context, RecordBatch incoming)
public int getRecordCount()
VectorAccessible
public SelectionVector4 getSelectionVector4()
getSelectionVector4
in interface VectorAccessible
getSelectionVector4
in class AbstractRecordBatch<ExternalSort>
public SelectionVector2 getSelectionVector2()
getSelectionVector2
in interface VectorAccessible
getSelectionVector2
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()
RecordBatch
getWritableBatch
in interface RecordBatch
getWritableBatch
in class AbstractRecordBatch<ExternalSort>
protected void cancelIncoming()
cancelIncoming
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 AutoCloseable
close
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)
public void dump()
RecordBatch
Copyright © 1970 The Apache Software Foundation. All rights reserved.