lastVLSN = VLSN.NULL_VLSN;
lastLsn = DbLsn.NULL_LSN;
return null;
}
VLSN indexVLSN = firstVLSN;
int newFirstIndex = -1;
/*
* Find the mappings that still belong. Using the example above, we
* should find that we can delete fileOffset[0] and fileOffset[1] and
* preserve fileOffset[2]
*/
for (int i = 0; i < fileOffsets.size(); i++) {
if ((indexVLSN.compareTo(lastDuplicate) > 0) &&
(fileOffsets.get(i) != NO_OFFSET)) {
newFirstIndex = i;
break;
}
indexVLSN = new VLSN(indexVLSN.getSequence() + stride);
}
VLSNBucket remainder = null;
int lastOffset;
if (newFirstIndex == -1) {
/*
* None of the VLSNs represented by the strided file offsets are
* needed anymore. This bucket consists solely of the last
* VLSN->LSN pair.
*/
lastOffset = fileOffsets.get(fileOffsets.size() - 1);
fileOffsets = new TruncateableList<Integer>();
fileOffsets.add(DbLsn.getFileOffsetAsInt(lastLsn));
firstVLSN = lastVLSN;
} else {
/* Move the still-valid mappings to a new list. */
assert (newFirstIndex > 0);
lastOffset = fileOffsets.get(newFirstIndex - 1);
TruncateableList<Integer> newFileOffsets =
new TruncateableList<Integer>
(fileOffsets.subList(newFirstIndex, fileOffsets.size()));
fileOffsets = newFileOffsets;
firstVLSN = new VLSN((newFirstIndex * stride) +
firstVLSN.getSequence());
}
if (!firstVLSN.equals(lastDuplicate.getNext())) {