/** * Inserts an intersecting range after current in the list and adjusts offset accordingly. * @param other the new element to insert * @return the new element. */ public DiskRangeList insertPartAfter(DiskRangeList other) { // The only allowed non-overlapping option is extra bytes at the end. if (other.offset > this.end || other.offset <= this.offset || other.end <= this.offset) { assertInvalidOrder(this.prev == null ? this : this.prev, this, other); } this.end = other.offset; return insertAfter(other); }
public void addOrMerge(long offset, long end, boolean doMerge, boolean doLogNew) { if (doMerge && tail != null && tail.merge(offset, end)) return; if (doLogNew) { LOG.debug("Creating new range; last range (which can include some previous adds) was " + tail); } DiskRangeList node = new DiskRangeList(offset, end); if (tail == null) { head = tail = node; } else { tail = tail.insertAfter(node); } }
one.position(0); two.position(0); bc.insertAfter(new BufferChunk(two, 1)).insertAfter(new BufferChunk(three, 2)); Arrays.fill(result, -1); rv = EncodedReaderImpl.readLengthBytesFromSmallBuffers(bc, 0l, result, l, true, trace);
currentCached.insertAfter(tail); return tail;
cp.verifyEquals(3); DiskRangeList ranges = new DiskRangeList(0, 3); ranges.insertAfter(new DiskRangeList(4, 6)); result = cache.getIncompleteCbs(fileKey1, ranges, 0, gotAllData); assertFalse(gotAllData.value); verifyResult(result, INCOMPLETE, 0, 3, DRL, 4, 6); ranges = new DiskRangeList(0, 3); ranges.insertAfter(new DiskRangeList(3, 5)).insertAfter(new DiskRangeList(5, 6)); result = cache.getIncompleteCbs(fileKey1, ranges, 0, gotAllData); assertFalse(gotAllData.value);
/** * Inserts an intersecting range after current in the list and adjusts offset accordingly. * @param other the new element to insert * @return the new element. */ public DiskRangeList insertPartAfter(DiskRangeList other) { // The only allowed non-overlapping option is extra bytes at the end. if (other.offset > this.end || other.offset <= this.offset || other.end <= this.offset) { assertInvalidOrder(this.prev == null ? this : this.prev, this, other); } this.end = other.offset; return insertAfter(other); }
public void addOrMerge(long offset, long end, boolean doMerge, boolean doLogNew) { if (doMerge && tail != null && tail.merge(offset, end)) return; if (doLogNew) { LOG.debug("Creating new range; last range (which can include some previous adds) was " + tail); } DiskRangeList node = new DiskRangeList(offset, end); if (tail == null) { head = tail = node; } else { tail = tail.insertAfter(node); } }
range.replaceSelfWith(bc); } else { range.insertAfter(bc);
hasReplaced = true; } else { range.insertAfter(bc);
hasReplaced = true; } else { range.insertAfter(bc);
hasReplaced = true; } else { range.insertAfter(bc);
currentCached.insertAfter(tail); return tail;