io.journalkeeper.core.state.EntryFutureImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of journalkeeper-core Show documentation
Show all versions of journalkeeper-core Show documentation
Journalkeeper core raft implementations.
package io.journalkeeper.core.state;
import io.journalkeeper.core.api.EntryFuture;
import io.journalkeeper.core.journal.Journal;
/**
* @author LiYue
* Date: 2020/3/2
*/
public class EntryFutureImpl implements EntryFuture {
private final Journal journal;
private final long offset;
public EntryFutureImpl(Journal journal, long offset) {
this.journal = journal;
this.offset = offset;
}
@Override
public byte[] get() {
return journal.readByOffset(offset).getPayload().getBytes();
}
}