use of io.atomix.storage.journal.index.Position in project atomix by atomix.
the class JournalSegmentReader method reset.
@Override
public void reset(long index) {
reset();
Position position = this.index.lookup(index - 1);
if (position != null) {
currentEntry = new Indexed<>(position.index() - 1, null, 0);
buffer.position(position.position());
readNext();
}
while (getNextIndex() < index && hasNext()) {
next();
}
}
use of io.atomix.storage.journal.index.Position in project atomix by atomix.
the class FileChannelJournalSegmentReader method reset.
@Override
public void reset(long index) {
reset();
Position position = this.index.lookup(index - 1);
if (position != null) {
currentEntry = new Indexed<>(position.index() - 1, null, 0);
try {
channel.position(position.position());
memory.clear().flip();
} catch (IOException e) {
throw new StorageException(e);
}
readNext();
}
while (getNextIndex() < index && hasNext()) {
next();
}
}
use of io.atomix.storage.journal.index.Position in project atomix by atomix.
the class MappedJournalSegmentReader method reset.
@Override
public void reset(long index) {
reset();
Position position = this.index.lookup(index - 1);
if (position != null) {
currentEntry = new Indexed<>(position.index() - 1, null, 0);
buffer.position(position.position());
readNext();
}
while (getNextIndex() < index && hasNext()) {
next();
}
}
Aggregations