Class FileRecoverer


  • public class FileRecoverer
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      FileRecoverer​(int replicaId, java.lang.String defaultDir)  
    • Constructor Detail

      • FileRecoverer

        public FileRecoverer​(int replicaId,
                             java.lang.String defaultDir)
    • 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 collected
        number - 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)