Class CommitLogArchiver


  • public class CommitLogArchiver
    extends java.lang.Object
    • Field Detail

      • format

        public static final java.time.format.DateTimeFormatter format
      • archivePending

        public final java.util.Map<java.lang.String,​java.util.concurrent.Future<?>> archivePending
    • Constructor Detail

      • CommitLogArchiver

        public CommitLogArchiver​(java.lang.String archiveCommand,
                                 java.lang.String restoreCommand,
                                 java.lang.String restoreDirectories,
                                 long restorePointInTimeInMicroseconds,
                                 CommitLogPosition snapshotCommitLogPosition,
                                 java.util.concurrent.TimeUnit precision)
    • Method Detail

      • maybeArchive

        public void maybeArchive​(java.lang.String path,
                                 java.lang.String name)
        Differs from the above because it can be used on any file, rather than only managed commit log segments (and thus cannot call waitForFinalSync), and in the treatment of failures.

        Used to archive files present in the commit log directory at startup (CASSANDRA-6904). Since the files being already archived by normal operation could cause subsequent hard-linking or other operations to fail, we should not throw errors on failure

      • maybeWaitForArchiving

        public boolean maybeWaitForArchiving​(java.lang.String name)
      • maybeRestoreArchive

        public void maybeRestoreArchive()
      • getRestorationPointInTimeInMicroseconds

        public static long getRestorationPointInTimeInMicroseconds​(java.lang.String restorationPointInTime)
        We change the restore_point_in_time from configuration file into microseconds level as Cassandra use microseconds as the timestamp.
        Parameters:
        restorationPointInTime - value of "restore_point_in_time" in properties file.
        Returns:
        microseconds value of restore_point_in_time
      • getRestorePointInTimeInMicroseconds

        public long getRestorePointInTimeInMicroseconds()
      • setRestorePointInTimeInMicroseconds

        public void setRestorePointInTimeInMicroseconds​(long restorePointInTimeInMicroseconds)
      • setPrecision

        public void setPrecision​(java.util.concurrent.TimeUnit timeUnit)