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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PushSorter<T>build()Creates a push-basedPushSorter.ExternalSorter<T>build(org.apache.flink.util.MutableObjectIterator<T> input)Creates a pull-basedSorter.ExternalSorterBuilder<T>enableSpilling(IOManager ioManager)ExternalSorterBuilder<T>enableSpilling(IOManager ioManager, double startSpillingFraction)ExternalSorterBuilder<T>largeRecords(boolean enabled)ExternalSorterBuilder<T>maxNumFileHandles(int maxNumFileHandles)ExternalSorterBuilder<T>memory(List<org.apache.flink.core.memory.MemorySegment> memorySegments)ExternalSorterBuilder<T>memoryFraction(double fraction)ExternalSorterBuilder<T>objectReuse(boolean enabled)ExternalSorterBuilder<T>sortBuffers(int numSortBuffers)ExternalSorterBuilder<T>sorterFactory(InMemorySorterFactory<T> sorterFactory)ExternalSorterBuilder<T>withCombiner(org.apache.flink.api.common.functions.GroupCombineFunction<T,T> combineFunction)ExternalSorterBuilder<T>withCombiner(org.apache.flink.api.common.functions.GroupCombineFunction<T,T> combineFunction, org.apache.flink.configuration.Configuration udfConfig)
-
-
-
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<org.apache.flink.core.memory.MemorySegment> memorySegments)
-
sortBuffers
public ExternalSorterBuilder<T> sortBuffers(int numSortBuffers)
-
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
public ExternalSorterBuilder<T> sorterFactory(InMemorySorterFactory<T> 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
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
-
-