use of org.apache.hadoop.hive.common.io.DiskRangeList.MutateHelper in project hive by apache.
the class OrcFileEstimateErrors method getIncompleteCbs.
public DiskRangeList getIncompleteCbs(DiskRangeList ranges, long baseOffset, BooleanRef gotAllData) {
DiskRangeList prev = ranges.prev;
if (prev == null) {
prev = new MutateHelper(ranges);
}
DiskRangeList current = ranges;
// Assume by default that we would find everything.
gotAllData.value = true;
while (current != null) {
// We assume ranges in "ranges" are non-overlapping; thus, we will save next in advance.
DiskRangeList check = current;
current = current.next;
if (check.hasData())
continue;
Integer badLength = cache.get(Long.valueOf(check.getOffset() + baseOffset));
if (badLength == null || badLength < check.getLength()) {
gotAllData.value = false;
continue;
}
// We could just remove here and handle the missing tail during read, but that can be
// dangerous; let's explicitly add an incomplete CB.
check.replaceSelfWith(new IncompleteCb(check.getOffset(), check.getEnd()));
}
return prev.next;
}
Aggregations