Class AbstractBinaryExternalMerger<Entry>

    • Field Detail

      • pageSize

        protected final int pageSize
      • ioManager

        protected final IOManager ioManager
    • Constructor Detail

      • AbstractBinaryExternalMerger

        public AbstractBinaryExternalMerger​(IOManager ioManager,
                                            int pageSize,
                                            int maxFanIn,
                                            SpillChannelManager channelManager,
                                            boolean compressionEnabled,
                                            BlockCompressionFactory compressionCodecFactory,
                                            int compressionBlockSize)
    • Method Detail

      • getMergingIterator

        public BinaryMergeIterator<Entry> getMergingIterator​(List<ChannelWithMeta> channelIDs,
                                                             List<FileIOChannel> openChannels)
                                                      throws IOException
        Returns an iterator that iterates over the merged result from all given channels.
        Parameters:
        channelIDs - The channels that are to be merged and returned.
        Returns:
        An iterator over the merged records of the input channels.
        Throws:
        IOException - Thrown, if the readers encounter an I/O problem.
      • mergeChannelList

        public List<ChannelWithMeta> mergeChannelList​(List<ChannelWithMeta> channelIDs)
                                               throws IOException
        Merges the given sorted runs to a smaller number of sorted runs.
        Parameters:
        channelIDs - The IDs of the sorted runs that need to be merged.
        Returns:
        A list of the IDs of the merged channels.
        Throws:
        IOException - Thrown, if the readers or writers encountered an I/O problem.
      • mergeComparator

        protected abstract Comparator<Entry> mergeComparator()
        Returns:
        merging comparator used in merging.
      • mergeReusedEntries

        protected abstract List<Entry> mergeReusedEntries​(int size)
        Returns:
        reused entry object used in merging.