earliestAvailableOffset property
int
earliestAvailableOffset
The earliest offset that still has a value
Implementation
int get earliestAvailableOffset =>
retention != 0 ? offset - log.length : offset;
Trim the log to the target offset
.
Implementation
set earliestAvailableOffset(int offset) {
if (offset > this.offset || offset < 1) return;
final targetLogLength = _offset - offset;
var toRemove = log.length - targetLogLength;
while (toRemove > 0) {
log.removeFirst();
toRemove--;
}
}