Package org.jgroups.raft.filelog
Class FilePositionCache
java.lang.Object
org.jgroups.raft.filelog.FilePositionCache
A mapping between the RAFT log index and where the log entry is stored in a file.
- Since:
- 0.5.4
- Author:
- Pedro Ruivo, Francesco Nigro
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFilePositionCache(long firstLogIndex) FilePositionCache(long firstLogIndex, int requiredPages) -
Method Summary
Modifier and TypeMethodDescriptioncreateDeleteCopyFrom(long logIndex) longlonglonggetPosition(long logIndex) booleaninvalidateFrom(long logIndex) booleanset(long logIndex, long position)
-
Field Details
-
TOO_OLD
public static final int TOO_OLD- See Also:
-
EMPTY
public static final int EMPTY- See Also:
-
-
Constructor Details
-
FilePositionCache
public FilePositionCache(long firstLogIndex) -
FilePositionCache
public FilePositionCache(long firstLogIndex, int requiredPages)
-
-
Method Details
-
getFirstLogIndex
public long getFirstLogIndex() -
getPosition
public long getPosition(long logIndex) -
set
public boolean set(long logIndex, long position) -
getFirstAppended
public long getFirstAppended() -
invalidateFrom
public boolean invalidateFrom(long logIndex) -
createDeleteCopyFrom
-