public final class ExternalSorterBuilder<T> extends Object
ExternalSorter
. It can construct either a pull-based sorter if provided
with an input iterator via build(MutableObjectIterator)
or a push-based one via build()
.public ExternalSorterBuilder<T> maxNumFileHandles(int maxNumFileHandles)
public ExternalSorterBuilder<T> objectReuse(boolean enabled)
public ExternalSorterBuilder<T> largeRecords(boolean enabled)
public ExternalSorterBuilder<T> enableSpilling(IOManager ioManager)
public ExternalSorterBuilder<T> enableSpilling(IOManager ioManager, double startSpillingFraction)
public ExternalSorterBuilder<T> memoryFraction(double fraction)
public ExternalSorterBuilder<T> memory(List<MemorySegment> memorySegments)
public ExternalSorterBuilder<T> sortBuffers(int numSortBuffers)
public ExternalSorterBuilder<T> withCombiner(GroupCombineFunction<T,T> combineFunction, Configuration udfConfig)
public ExternalSorterBuilder<T> withCombiner(GroupCombineFunction<T,T> combineFunction)
public ExternalSorterBuilder<T> sorterFactory(InMemorySorterFactory<T> sorterFactory)
public ExternalSorter<T> build(MutableObjectIterator<T> input) throws MemoryAllocationException
Sorter
. The CloseableInputProvider.getIterator()
will return when all
the records from the given input are consumed. Will spawn three threads: read, sort, spill.MemoryAllocationException
public PushSorter<T> build() throws MemoryAllocationException
PushSorter
. The CloseableInputProvider.getIterator()
will return
when the PushSorter.finishReading()
is called. Will spawn two threads: sort, spill.MemoryAllocationException
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.