Class ExternalSorterBuilder<T>
- java.lang.Object
-
- org.apache.flink.runtime.operators.sort.ExternalSorterBuilder<T>
-
public final class ExternalSorterBuilder<T> extends Object
A builder for anExternalSorter
. It can construct either a pull-based sorter if provided with an input iterator viabuild(MutableObjectIterator)
or a push-based one viabuild()
.
-
-
Method Summary
-
-
-
Method Detail
-
maxNumFileHandles
public ExternalSorterBuilder<T> maxNumFileHandles(int maxNumFileHandles)
-
objectReuse
public ExternalSorterBuilder<T> objectReuse(boolean enabled)
-
largeRecords
public ExternalSorterBuilder<T> largeRecords(boolean enabled)
-
enableSpilling
public ExternalSorterBuilder<T> enableSpilling(IOManager ioManager)
-
enableSpilling
public ExternalSorterBuilder<T> enableSpilling(IOManager ioManager, double startSpillingFraction)
-
memoryFraction
public ExternalSorterBuilder<T> memoryFraction(double fraction)
-
memory
public ExternalSorterBuilder<T> memory(List<MemorySegment> memorySegments)
-
sortBuffers
public ExternalSorterBuilder<T> sortBuffers(int numSortBuffers)
-
withCombiner
public ExternalSorterBuilder<T> withCombiner(GroupCombineFunction<T,T> combineFunction, Configuration udfConfig)
-
withCombiner
public ExternalSorterBuilder<T> withCombiner(GroupCombineFunction<T,T> combineFunction)
-
sorterFactory
public ExternalSorterBuilder<T> sorterFactory(InMemorySorterFactory<T> sorterFactory)
-
build
public ExternalSorter<T> build(MutableObjectIterator<T> input) throws MemoryAllocationException
Creates a pull-basedSorter
. TheCloseableInputProvider.getIterator()
will return when all the records from the given input are consumed. Will spawn three threads: read, sort, spill.- Throws:
MemoryAllocationException
-
build
public PushSorter<T> build() throws MemoryAllocationException
Creates a push-basedPushSorter
. TheCloseableInputProvider.getIterator()
will return when thePushSorter.finishReading()
is called. Will spawn two threads: sort, spill.- Throws:
MemoryAllocationException
-
-