Class FileRecoverer
- java.lang.Object
-
- bftsmart.tom.server.defaultservices.FileRecoverer
-
public class FileRecoverer extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description FileRecoverer(int replicaId, java.lang.String defaultDir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCkpLastConsensusId()byte[]getCkpState(java.lang.String ckpPath)byte[]getCkpStateHash()java.lang.StringgetLatestFile(java.lang.String extention)intgetLogLastConsensusId()CommandsInfo[]getLogState(int index, java.lang.String logPath)Reads all log messages from the last log file createdCommandsInfo[]getLogState(long pointer, int startOffset, int number, java.lang.String logPath)Recover portions of the log for collaborative state transfer.voidrecoverCkpHash(java.lang.String ckpPath)voidtransferCkpState(java.nio.channels.SocketChannel sChannel, java.lang.String ckpPath)voidtransferLog(java.nio.channels.SocketChannel sChannel, int index, java.lang.String logPath)
-
-
-
Method Detail
-
getLogState
public CommandsInfo[] getLogState(int index, java.lang.String logPath)
Reads all log messages from the last log file created- Returns:
- an array with batches of messages executed for each consensus
-
getLogState
public CommandsInfo[] getLogState(long pointer, int startOffset, int number, java.lang.String logPath)
Recover portions of the log for collaborative state transfer.- Parameters:
start- the index for which the commands start to be collectednumber- the number of commands retrieved- Returns:
- The commands for the period selected
-
getCkpState
public byte[] getCkpState(java.lang.String ckpPath)
-
recoverCkpHash
public void recoverCkpHash(java.lang.String ckpPath)
-
transferLog
public void transferLog(java.nio.channels.SocketChannel sChannel, int index, java.lang.String logPath)
-
transferCkpState
public void transferCkpState(java.nio.channels.SocketChannel sChannel, java.lang.String ckpPath)
-
getCkpStateHash
public byte[] getCkpStateHash()
-
getCkpLastConsensusId
public int getCkpLastConsensusId()
-
getLogLastConsensusId
public int getLogLastConsensusId()
-
getLatestFile
public java.lang.String getLatestFile(java.lang.String extention)
-
-