Class CommitLogArchiver
- java.lang.Object
-
- org.apache.cassandra.db.commitlog.CommitLogArchiver
-
public class CommitLogArchiver extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description java.util.Map<java.lang.String,java.util.concurrent.Future<?>>
archivePending
static java.time.format.DateTimeFormatter
format
-
Constructor Summary
Constructors Constructor Description CommitLogArchiver(java.lang.String archiveCommand, java.lang.String restoreCommand, java.lang.String restoreDirectories, long restorePointInTimeInMicroseconds, CommitLogPosition snapshotCommitLogPosition, java.util.concurrent.TimeUnit precision)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CommitLogArchiver
construct()
static CommitLogArchiver
disabled()
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.long
getRestorePointInTimeInMicroseconds()
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.void
maybeArchive(CommitLogSegment segment)
void
maybeRestoreArchive()
boolean
maybeWaitForArchiving(java.lang.String name)
void
setPrecision(java.util.concurrent.TimeUnit timeUnit)
void
setRestorePointInTimeInMicroseconds(long restorePointInTimeInMicroseconds)
-
-
-
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
-
disabled
public static CommitLogArchiver disabled()
-
construct
public static CommitLogArchiver construct()
-
maybeArchive
public void maybeArchive(CommitLogSegment segment)
-
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)
-
-