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
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classReturn results for a single input batch.static interfaceIterates over the final sorted results. -
Constructor Summary
ConstructorsConstructorDescriptionSortImpl(OperatorContext opContext, SortConfig sortConfig, SpilledRuns spilledRuns, VectorContainer batch) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBatch(VectorAccessible incoming) Process the converted incoming batch by adding it to the in-memory store of data, or spilling data to disk when necessary.voidclose()booleanvoidsetSchema(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
-