All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.journalkeeper.core.state.EntryFutureImpl Maven / Gradle / Ivy

There is a newer version: 0.1.11
Show newest version
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();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy