public SSTableReader cloneAsShadowed(final Runnable runOnClose) { synchronized (tidy.global) { assert openReason != OpenReason.EARLY; this.tidy.runOnClose = new DropPageCache(dfile, 0, ifile, 0, runOnClose); return cloneAndReplace(first, OpenReason.SHADOWED); } }
/** * Clone this reader with the provided start and open reason, and set the clone as replacement. * * @param newFirst the first key for the replacement (which can be different from the original due to the pre-emptive * opening of compaction results). * @param reason the {@code OpenReason} for the replacement. * * @return the cloned reader. That reader is set as a replacement by the method. */ private SSTableReader cloneAndReplace(DecoratedKey newFirst, OpenReason reason) { return cloneAndReplace(newFirst, reason, indexSummary.sharedCopy()); }
public SSTableReader cloneWithNewStart(DecoratedKey newStart, final Runnable runOnClose) { synchronized (tidy.global) { assert openReason != OpenReason.EARLY; // TODO: merge with caller's firstKeyBeyond() work,to save time if (newStart.compareTo(first) > 0) { final long dataStart = getPosition(newStart, Operator.EQ).position; final long indexStart = getIndexScanPosition(newStart); this.tidy.runOnClose = new DropPageCache(dfile, dataStart, ifile, indexStart, runOnClose); } return cloneAndReplace(newStart, OpenReason.MOVED_START); } }
parent.metric.liveDiskSpaceUsed.inc(newSize - oldSize); return cloneAndReplace(first, OpenReason.METADATA_CHANGE, newSummary);