public class InMemoryRaftLog extends Object implements RaftLog
PHYSICAL_LOG_DIRECTORY_NAME| Constructor and Description |
|---|
InMemoryRaftLog() |
| Modifier and Type | Method and Description |
|---|---|
long |
append(RaftLogEntry... entries)
Appends entry to the end of the log.
|
long |
appendIndex() |
boolean |
equals(Object o) |
RaftLogCursor |
getEntryCursor(long fromIndex)
Returns a
RaftLogCursor of RaftLogEntrys from the specified index until the end of the log |
int |
hashCode() |
long |
prevIndex() |
long |
prune(long safeIndex)
Attempt to prune (delete) a prefix of the log, no further than the safeIndex.
|
long |
readEntryTerm(long logIndex)
Reads the term associated with the entry at the supplied index.
|
long |
skip(long index,
long term)
Skip up to the supplied index if it is not already present.
|
void |
truncate(long fromIndex)
Truncates the log starting from the supplied index.
|
public long append(RaftLogEntry... entries) throws IOException
RaftLogappend in interface RaftLogentries - The log entry.IOExceptionpublic long prune(long safeIndex)
RaftLogpublic long appendIndex()
appendIndex in interface ReadableRaftLogpublic long prevIndex()
prevIndex in interface ReadableRaftLogpublic long readEntryTerm(long logIndex)
ReadableRaftLogreadEntryTerm in interface ReadableRaftLoglogIndex - The index of the log entry.public void truncate(long fromIndex)
RaftLogpublic RaftLogCursor getEntryCursor(long fromIndex) throws IOException
ReadableRaftLogRaftLogCursor of RaftLogEntrys from the specified index until the end of the loggetEntryCursor in interface ReadableRaftLogfromIndex - The log index at which the cursor should be positionedIOExceptionpublic long skip(long index,
long term)
RaftLogCopyright © 2002–2016 The Neo4j Graph Database Project. All rights reserved.