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
-
canUseRadixSort
flag
UnsafeExternalSorter
is created when:
UnsafeExternalSorter
utility 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:
UnsafeKVExternalSorter
is 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:
UnsafeExternalRowSorter
andUnsafeKVExternalSorter
are created