public void logPartialCb(DiskRange current) { if (log == null) return; int offset = this.offset; if (offset + 4 > log.length) return; log[offset] = makeIntPair(PARTIAL_CB, 0); logRange(current, offset + 1); this.offset += 4; }
public void logCompositeOrcCb(int lastChunkTaken, int lastChunkRemaining, DiskRange cc) { if (log == null) return; int offset = this.offset; if (offset + 5 > log.length) return; log[offset] = makeIntPair(COMPOSITE_ORC_CB, lastChunkTaken); log[offset + 1] = lastChunkRemaining; logRange(cc, offset + 2); this.offset += 5; }
public void logCacheCollision(DiskRange replacedChunk, MemoryBuffer replacementBuffer) { if (log == null) return; int offset = this.offset; if (offset + 4 > log.length) return; log[offset] = makeIntPair(CACHE_COLLISION, System.identityHashCode(replacementBuffer)); logRange(replacedChunk, offset + 1); this.offset += 4; }
public void logRanges(Object fileKey, long baseOffset, DiskRangeList range, RangesSrc src) { if (log == null) return; int offset = this.offset; if (offset + 3 > log.length) return; // At least the header should fit. log[offset + 1] = (fileKey instanceof Long) ? (long)fileKey : fileKey.hashCode(); log[offset + 2] = baseOffset; int elementCount = 0; int currentOffset = offset + 3; while (range != null && elementCount < MAX_ELEMENTS) { if (currentOffset + 3 > log.length) break; logRange(range, currentOffset); currentOffset += 3; ++elementCount; range = range.next; } log[offset] = makeIntPair(RANGES, (src.ordinal() << MAX_ELEMENT_BITS) | elementCount); this.offset = currentOffset; }