UnsafeExternalSorter¶
UnsafeExternalSorter is a MemoryConsumer.
Creating Instance¶
UnsafeExternalSorter takes the following to be created:
- TaskMemoryManager
- BlockManager
- SerializerManager
- TaskContext
- RecordComparator Supplier
-
PrefixComparator - Initial Size
- Page size (in bytes)
- numElementsForSpillThreshold
- UnsafeInMemorySorter
-
canUseRadixSortflag
UnsafeExternalSorter is created when:
UnsafeExternalSorterutility is used to createWithExistingInMemorySorter and create
createWithExistingInMemorySorter¶
UnsafeExternalSorter createWithExistingInMemorySorter(
TaskMemoryManager taskMemoryManager,
BlockManager blockManager,
SerializerManager serializerManager,
TaskContext taskContext,
Supplier<RecordComparator> recordComparatorSupplier,
PrefixComparator prefixComparator,
int initialSize,
long pageSizeBytes,
int numElementsForSpillThreshold,
UnsafeInMemorySorter inMemorySorter,
long existingMemoryConsumption)
createWithExistingInMemorySorter...FIXME
createWithExistingInMemorySorter is used when:
UnsafeKVExternalSorteris created
create¶
UnsafeExternalSorter create(
TaskMemoryManager taskMemoryManager,
BlockManager blockManager,
SerializerManager serializerManager,
TaskContext taskContext,
Supplier<RecordComparator> recordComparatorSupplier,
PrefixComparator prefixComparator,
int initialSize,
long pageSizeBytes,
int numElementsForSpillThreshold,
boolean canUseRadixSort)
create creates a new UnsafeExternalSorter with no UnsafeInMemorySorter given (null).
create is used when:
UnsafeExternalRowSorterandUnsafeKVExternalSorterare created