Map.Entry<Long, LlapDataBuffer> e = matches.next(); LlapDataBuffer buffer = e.getValue(); long requestedLength = currentNotCached.getLength(); cacheOffset - baseOffset, cacheEnd - baseOffset); currentNotCached = addCachedBufferToIter(currentNotCached, currentCached, gotAllData); metrics.incrCacheHitBytes(Math.min(requestedLength, currentCached.getLength()));
public DiskRangeList getIncompleteCbs( DiskRangeList ranges, long baseOffset, BooleanRef gotAllData) { DiskRangeList prev = ranges.prev; if (prev == null) { prev = new MutateHelper(ranges); } DiskRangeList current = ranges; gotAllData.value = true; // Assume by default that we would find everything. 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; }
Map.Entry<Long, LlapDataBuffer> e = matches.next(); LlapDataBuffer buffer = e.getValue(); long requestedLength = currentNotCached.getLength(); cacheOffset - baseOffset, cacheEnd - baseOffset); currentNotCached = addCachedBufferToIter(currentNotCached, currentCached, gotAllData); metrics.incrCacheHitBytes(Math.min(requestedLength, currentCached.getLength()));
public DiskRangeList getIncompleteCbs( DiskRangeList ranges, long baseOffset, BooleanRef gotAllData) { DiskRangeList prev = ranges.prev; if (prev == null) { prev = new MutateHelper(ranges); } DiskRangeList current = ranges; gotAllData.value = true; // Assume by default that we would find everything. 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; }