package org.mitallast.queue.raft.log;

import org.mitallast.queue.raft.log.entry.RaftLogEntry;

import java.io.IOException;

public interface RaftLog {

    boolean isEmpty();

    long size();

    long length();

    long firstIndex();

    long nextIndex();

    long lastIndex();

    long appendEntry(RaftLogEntry entry) throws IOException;

    <T extends RaftLogEntry> T getEntry(long index) throws IOException;

    boolean containsIndex(long index);

    boolean containsEntry(long index) throws IOException;

    void skip(long entries) throws IOException;

    void truncate(long index) throws IOException;

    void flush() throws IOException;

    void delete() throws IOException;
}

@@ -178,21 +178,115 @@
     
-long size();%0A
+/**%0A     * @return size in bytes%0A     */%0A    long size();%0A%0A    /**%0A     * @return log entries count%0A     */
 %0A   

add comments to raft log