Entry - Type of Entry to Merge sort.public abstract class AbstractBinaryExternalMerger<Entry> extends Object implements Closeable
BinaryExternalSorter. It merges maxFanIn spilled files
at most once.| Modifier and Type | Field and Description |
|---|---|
protected org.apache.flink.runtime.io.disk.iomanager.IOManager |
ioManager |
protected int |
pageSize |
| Constructor and Description |
|---|
AbstractBinaryExternalMerger(org.apache.flink.runtime.io.disk.iomanager.IOManager ioManager,
int pageSize,
int maxFanIn,
SpillChannelManager channelManager,
boolean compressionEnabled,
org.apache.flink.runtime.io.compression.BlockCompressionFactory compressionCodecFactory,
int compressionBlockSize) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract org.apache.flink.util.MutableObjectIterator<Entry> |
channelReaderInputViewIterator(org.apache.flink.runtime.io.disk.iomanager.AbstractChannelReaderInputView inView) |
void |
close() |
BinaryMergeIterator<Entry> |
getMergingIterator(List<ChannelWithMeta> channelIDs,
List<org.apache.flink.runtime.io.disk.iomanager.FileIOChannel> openChannels)
Returns an iterator that iterates over the merged result from all given channels.
|
List<ChannelWithMeta> |
mergeChannelList(List<ChannelWithMeta> channelIDs)
Merges the given sorted runs to a smaller number of sorted runs.
|
protected abstract Comparator<Entry> |
mergeComparator() |
protected abstract List<Entry> |
mergeReusedEntries(int size) |
protected abstract void |
writeMergingOutput(org.apache.flink.util.MutableObjectIterator<Entry> mergeIterator,
org.apache.flink.runtime.memory.AbstractPagedOutputView output)
read the merged stream and write the data back.
|
protected final int pageSize
protected final org.apache.flink.runtime.io.disk.iomanager.IOManager ioManager
public AbstractBinaryExternalMerger(org.apache.flink.runtime.io.disk.iomanager.IOManager ioManager,
int pageSize,
int maxFanIn,
SpillChannelManager channelManager,
boolean compressionEnabled,
org.apache.flink.runtime.io.compression.BlockCompressionFactory compressionCodecFactory,
int compressionBlockSize)
public void close()
close in interface Closeableclose in interface AutoCloseablepublic BinaryMergeIterator<Entry> getMergingIterator(List<ChannelWithMeta> channelIDs, List<org.apache.flink.runtime.io.disk.iomanager.FileIOChannel> openChannels) throws IOException
channelIDs - The channels that are to be merged and returned.IOException - Thrown, if the readers encounter an I/O problem.public List<ChannelWithMeta> mergeChannelList(List<ChannelWithMeta> channelIDs) throws IOException
channelIDs - The IDs of the sorted runs that need to be merged.IOException - Thrown, if the readers or writers encountered an I/O problem.protected abstract org.apache.flink.util.MutableObjectIterator<Entry> channelReaderInputViewIterator(org.apache.flink.runtime.io.disk.iomanager.AbstractChannelReaderInputView inView)
protected abstract Comparator<Entry> mergeComparator()
protected abstract List<Entry> mergeReusedEntries(int size)
protected abstract void writeMergingOutput(org.apache.flink.util.MutableObjectIterator<Entry> mergeIterator, org.apache.flink.runtime.memory.AbstractPagedOutputView output) throws IOException
IOExceptionCopyright © 2014–2025 The Apache Software Foundation. All rights reserved.