Class ExternalSorterBuilder<T>
java.lang.Object
org.apache.flink.runtime.operators.sort.ExternalSorterBuilder<T>
A builder for an
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().-
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates a push-basedPushSorter.Creates a pull-basedSorter.enableSpilling(IOManager ioManager) enableSpilling(IOManager ioManager, double startSpillingFraction) largeRecords(boolean enabled) maxNumFileHandles(int maxNumFileHandles) memoryFraction(double fraction) objectReuse(boolean enabled) sortBuffers(int numSortBuffers) sorterFactory(InMemorySorterFactory<T> sorterFactory) withCombiner(org.apache.flink.api.common.functions.GroupCombineFunction<T, T> combineFunction) withCombiner(org.apache.flink.api.common.functions.GroupCombineFunction<T, T> combineFunction, org.apache.flink.configuration.Configuration udfConfig)
-
Method Details
-
maxNumFileHandles
-
objectReuse
-
largeRecords
-
enableSpilling
-
enableSpilling
-
memoryFraction
-
memory
public ExternalSorterBuilder<T> memory(List<org.apache.flink.core.memory.MemorySegment> memorySegments) -
sortBuffers
-
withCombiner
public ExternalSorterBuilder<T> withCombiner(org.apache.flink.api.common.functions.GroupCombineFunction<T, T> combineFunction, org.apache.flink.configuration.Configuration udfConfig) -
withCombiner
public ExternalSorterBuilder<T> withCombiner(org.apache.flink.api.common.functions.GroupCombineFunction<T, T> combineFunction) -
sorterFactory
-
build
public ExternalSorter<T> build(org.apache.flink.util.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
Creates a push-basedPushSorter. TheCloseableInputProvider.getIterator()will return when thePushSorter.finishReading()is called. Will spawn two threads: sort, spill.- Throws:
MemoryAllocationException
-