Package org.apache.hadoop.fs.impl
Class CombinedFileRange
java.lang.Object
org.apache.hadoop.fs.impl.FileRangeImpl
org.apache.hadoop.fs.impl.CombinedFileRange
- All Implemented Interfaces:
FileRange
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongGet the total amount of data which is actually useful; the difference between this andFileRangeImpl.getLength()records how much data which will be discarded.Get the list of ranges that were merged together to form this one.booleanMerge this input range into the current one, if it is compatible.toString()Methods inherited from class org.apache.hadoop.fs.impl.FileRangeImpl
getData, getLength, getOffset, getReference, setData, setLength, setOffset
-
Constructor Details
-
CombinedFileRange
-
-
Method Details
-
getUnderlying
Get the list of ranges that were merged together to form this one.- Returns:
- the list of input ranges
-
merge
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 mergingotherEnd- the end to consider mergingother- the underlying FileRange to add if we mergeminSeek- the minimum distance that we'll seek without merging the ranges togethermaxSize- the maximum size that we'll merge into a single range- Returns:
- true if we have merged the range into this one
-
toString
- Overrides:
toStringin classFileRangeImpl
-
getDataSize
public long getDataSize()Get the total amount of data which is actually useful; the difference between this andFileRangeImpl.getLength()records how much data which will be discarded.- Returns:
- a number greater than 0 and less than or equal to
FileRangeImpl.getLength().
-