use of org.apache.flink.runtime.io.disk.iomanager.AbstractChannelReaderInputView in project flink by apache.
the class AbstractBinaryExternalMerger method getMergingIterator.
/**
* Returns an iterator that iterates over the merged result from all given channels.
*
* @param channelIDs The channels that are to be merged and returned.
* @return An iterator over the merged records of the input channels.
* @throws IOException Thrown, if the readers encounter an I/O problem.
*/
public BinaryMergeIterator<Entry> getMergingIterator(List<ChannelWithMeta> channelIDs, List<FileIOChannel> openChannels) throws IOException {
// create one iterator per channel id
if (LOG.isDebugEnabled()) {
LOG.debug("Performing merge of " + channelIDs.size() + " sorted streams.");
}
final List<MutableObjectIterator<Entry>> iterators = new ArrayList<>(channelIDs.size() + 1);
for (ChannelWithMeta channel : channelIDs) {
AbstractChannelReaderInputView view = FileChannelUtil.createInputView(ioManager, channel, openChannels, compressionEnable, compressionCodecFactory, compressionBlockSize, pageSize);
iterators.add(channelReaderInputViewIterator(view));
}
return new BinaryMergeIterator<>(iterators, mergeReusedEntries(channelIDs.size()), mergeComparator());
}
Aggregations