Class CombinedFileRange

java.lang.Object
org.apache.hadoop.fs.impl.FileRangeImpl
org.apache.hadoop.fs.impl.CombinedFileRange
All Implemented Interfaces:
FileRange

@Private public class CombinedFileRange extends FileRangeImpl
A file range that represents a set of underlying file ranges. This is used when we combine the user's FileRange objects together into a single read for efficiency.

This class is not part of the public API; it MAY BE used as a parameter to vector IO operations in FileSystem implementation code (and is)

  • Constructor Details

    • CombinedFileRange

      public CombinedFileRange(long offset, long end, FileRange original)
  • Method Details

    • getUnderlying

      public List<FileRange> getUnderlying()
      Get the list of ranges that were merged together to form this one.
      Returns:
      the list of input ranges
    • merge

      public boolean merge(long otherOffset, long otherEnd, FileRange other, int minSeek, int maxSize)
      Merge this input range into the current one, if it is compatible. It is assumed that otherOffset is greater or equal the current offset, which typically happens by sorting the input ranges on offset.
      Parameters:
      otherOffset - the offset to consider merging
      otherEnd - the end to consider merging
      other - the underlying FileRange to add if we merge
      minSeek - the minimum distance that we'll seek without merging the ranges together
      maxSize - the maximum size that we'll merge into a single range
      Returns:
      true if we have merged the range into this one
    • toString

      public String toString()
      Overrides:
      toString in class FileRangeImpl
    • getDataSize

      public long getDataSize()
      Get the total amount of data which is actually useful; the difference between this and FileRangeImpl.getLength() records how much data which will be discarded.
      Returns:
      a number greater than 0 and less than or equal to FileRangeImpl.getLength().