@Singleton public class SnapshotMetaTask extends AbstractBackup
IBackupRestoreConfig.getSnapshotMetaServiceCronExpression()
The intent of this service is to run
a full snapshot on Cassandra, get the list of the SSTables on disk and then create a
manifest.json file which will encapsulate the list of the files i.e. capture filesystem at a
moment in time. This manifest.json file will ensure the true filesystem status is exposed (for
external entities) and will be used in future for Priam Backup Version 2 where a file is not
uploaded to backup file system unless SSTable has been modified. This will lead to huge reduction
in storage costs and provide bandwidth back to Cassandra instead of creating/uploading snapshots.
Note that this component will "try" to enqueue the files to upload, but no guarantee is provided.
If the enqueue fails for any reason, it is considered "OK" as there will be another service
pushing all the files in the queue for upload (think of this like a cleanup thread and will help
us in "resuming" any failed backup for any reason). Created by aagrawal on 6/18/18.Task.STATE
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
JOBNAME |
SNAPSHOT_FOLDER
Modifier and Type | Method and Description |
---|---|
void |
execute() |
java.lang.String |
getName() |
static TaskTimer |
getTimer(IBackupRestoreConfig config)
Interval between generating snapshot meta file using
SnapshotMetaTask . |
static boolean |
isBackupEnabled(IBackupRestoreConfig backupRestoreConfig) |
protected void |
processColumnFamily(java.io.File backupDir)
Process the columnfamily in a given snapshot/backup directory.
|
void |
uploadFiles()
Enqueue all the files for upload in the snapshot directory.
|
getBackupDirectories, getColumnFamily, getKeyspace, getSecondaryIndexDirectories, initiateBackup, isAReadableDirectory
execute, getErrorCount, getExecutionCount, initialize, state
public static final java.lang.String JOBNAME
public static TaskTimer getTimer(IBackupRestoreConfig config) throws java.lang.IllegalArgumentException
SnapshotMetaTask
.config
- IBackupRestoreConfig.getSnapshotMetaServiceCronExpression()
to get
configuration details from priam. Use "-1" to disable the service.java.lang.IllegalArgumentException
- if the configuration is not set correctly or are not valid.
This is to ensure we fail-fast.public static boolean isBackupEnabled(IBackupRestoreConfig backupRestoreConfig) throws java.lang.Exception
java.lang.Exception
public void uploadFiles()
public void execute() throws java.lang.Exception
protected void processColumnFamily(java.io.File backupDir) throws java.lang.Exception
AbstractBackup
processColumnFamily
in class AbstractBackup
backupDir
- Location of the backup/snapshot directory in that columnfamily.java.lang.Exception
- throws exception if there is any error in process the directory.