Class SortImpl
java.lang.Object
org.apache.drill.exec.physical.impl.xsort.SortImpl
Implementation of the external sort which is wrapped into the Drill
"next" protocol by the
ExternalSortBatch
class.
Accepts incoming batches. Sorts each and will spill to disk as needed. When all input is delivered, can either do an in-memory merge or a merge from disk. If runs spilled, may have to do one or more "consolidation" passes to reduce the number of runs to the level that will fit in memory.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
Return results for a single input batch.static interface
Iterates over the final sorted results. -
Constructor Summary
ConstructorDescriptionSortImpl
(OperatorContext opContext, SortConfig sortConfig, SpilledRuns spilledRuns, VectorContainer batch) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBatch
(VectorAccessible incoming) Process the converted incoming batch by adding it to the in-memory store of data, or spilling data to disk when necessary.void
close()
boolean
void
setSchema
(BatchSchema schema) toString()
-
Constructor Details
-
SortImpl
public SortImpl(OperatorContext opContext, SortConfig sortConfig, SpilledRuns spilledRuns, VectorContainer batch)
-
-
Method Details
-
opContext
-
setSchema
-
forceSpill
public boolean forceSpill() -
addBatch
Process the converted incoming batch by adding it to the in-memory store of data, or spilling data to disk when necessary.- Parameters:
incoming
-
-
getMetrics
-
startMerge
-
close
public void close() -
toString
-