Class CommitLogArchiver

java.lang.Object
org.apache.cassandra.db.commitlog.CommitLogArchiver

public class CommitLogArchiver extends Object
  • Field Details

  • Constructor Details

    • CommitLogArchiver

      public CommitLogArchiver(String archiveCommand, String restoreCommand, String restoreDirectories, long restorePointInTimeInMicroseconds, CommitLogPosition snapshotCommitLogPosition, TimeUnit precision)
  • Method Details

    • disabled

      public static CommitLogArchiver disabled()
    • construct

      public static CommitLogArchiver construct()
    • maybeArchive

      public void maybeArchive(CommitLogSegment segment)
    • maybeArchive

      public void maybeArchive(String path, 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(String name)
    • maybeRestoreArchive

      public void maybeRestoreArchive()
    • getRestorationPointInTimeInMicroseconds

      public static long getRestorationPointInTimeInMicroseconds(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(TimeUnit timeUnit)