org.apache.cassandra.db.commitlog

## Class CommitLogArchiver

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

    public class CommitLogArchiver
    extends java.lang.Object

### Field Summary

Fields
`java.util.Map<java.lang.String,java.util.concurrent.Future<?>>` `archivePending`
`static java.text.SimpleDateFormat` `format`
`java.util.concurrent.TimeUnit` `precision`
`long` `restorePointInTime`

### Constructor Summary

Constructors
Constructor and Description
`CommitLogArchiver(java.lang.String archiveCommand, java.lang.String restoreCommand, java.lang.String restoreDirectories, long restorePointInTime, java.util.concurrent.TimeUnit precision)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static CommitLogArchiver` `construct()`
`static CommitLogArchiver` `disabled()`
`void` `maybeArchive(CommitLogSegment segment)`
`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` `maybeRestoreArchive()`
`boolean` `maybeWaitForArchiving(java.lang.String name)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### format

    public static final java.text.SimpleDateFormat format

#### archivePending

    public final java.util.Map<java.lang.String,java.util.concurrent.Future<?>> archivePending

#### restorePointInTime

    public long restorePointInTime

#### precision

    public final java.util.concurrent.TimeUnit precision

### Constructor Detail

#### CommitLogArchiver

    public CommitLogArchiver(java.lang.String archiveCommand,
                             java.lang.String restoreCommand,
                             java.lang.String restoreDirectories,
                             long restorePointInTime,
                             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()