while (sizeToEvict + dirSelected.getAvailableBytes() < requestSize) {
Pair<Long, Long> oldestAccess = getLRUBlock(dirSelected, blockIdSet, pinList);
if (oldestAccess.getFirst() != -1) {
long blockSize = dirSelected.getBlockSize(oldestAccess.getFirst());
sizeToEvict += blockSize;
blockInfoList.add(new BlockInfo(dirSelected, oldestAccess.getFirst(), blockSize));
blockIdSet.add(oldestAccess.getFirst());
} else {
break;
}
}