@InterfaceAudience.Private public class BackupManifest extends Object
Modifier and Type | Class and Description |
---|---|
static class |
BackupManifest.BackupImage
Backup image, the dependency graph is made up by series of backup images BackupImage contains
all the relevant information to restore the backup and is used during restore operation
|
Modifier and Type | Field and Description |
---|---|
private BackupManifest.BackupImage |
backupImage |
private static org.slf4j.Logger |
LOG |
static String |
MANIFEST_FILE_NAME |
Constructor and Description |
---|
BackupManifest(BackupInfo backup)
Construct manifest for a ongoing backup.
|
BackupManifest(BackupInfo backup,
TableName table)
Construct a table level manifest for a backup of the named table.
|
BackupManifest(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path backupPath)
Construct manifest from a backup directory.
|
BackupManifest(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path backupPath)
Construct manifest from a backup directory.
|
Modifier and Type | Method and Description |
---|---|
void |
addDependentImage(BackupManifest.BackupImage image)
Add dependent backup image for this backup.
|
static boolean |
canCoverImage(ArrayList<BackupManifest.BackupImage> fullImages,
BackupManifest.BackupImage image)
Check whether backup image set could cover a backup image or not.
|
static boolean |
canCoverImage(BackupManifest.BackupImage image1,
BackupManifest.BackupImage image2)
Check whether backup image1 could cover backup image2 or not.
|
ArrayList<BackupManifest.BackupImage> |
getAllDependentListByTable(TableName table)
Get the full dependent image list in the whole dependency scope for a specific table of this
backup in time order from old to new.
|
BackupManifest.BackupImage |
getBackupImage()
Get this backup image.
|
ArrayList<BackupManifest.BackupImage> |
getDependentListByTable(TableName table)
Get the dependent image list for a specific table of this backup in time order from old to new
if want to restore to this backup image level.
|
Map<TableName,Map<String,Long>> |
getIncrTimestampMap() |
ArrayList<BackupManifest.BackupImage> |
getRestoreDependentList(boolean reverse)
Get the image list of this backup for restore in time order.
|
List<TableName> |
getTableList()
Get the table set of this image.
|
BackupType |
getType() |
void |
setIncrTimestampMap(Map<TableName,Map<String,Long>> incrTimestampMap)
Set the incremental timestamp map directly.
|
void |
store(org.apache.hadoop.conf.Configuration conf)
TODO: fix it.
|
BackupInfo |
toBackupInfo() |
private static final org.slf4j.Logger LOG
public static final String MANIFEST_FILE_NAME
private BackupManifest.BackupImage backupImage
public BackupManifest(BackupInfo backup)
backup
- The ongoing backup infopublic BackupManifest(BackupInfo backup, TableName table)
backup
- The ongoing backup session infopublic BackupManifest(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path backupPath) throws IOException
conf
- configurationbackupPath
- backup pathIOException
- if constructing the manifest from the backup directory failspublic BackupManifest(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path backupPath) throws BackupException
fs
- the FileSystembackupPath
- backup pathBackupException
- exceptionpublic BackupType getType()
public List<TableName> getTableList()
public void store(org.apache.hadoop.conf.Configuration conf) throws BackupException
BackupException
- if an error occurred while storing the manifest file.public BackupManifest.BackupImage getBackupImage()
public void addDependentImage(BackupManifest.BackupImage image)
image
- The direct dependent backup imagepublic void setIncrTimestampMap(Map<TableName,Map<String,Long>> incrTimestampMap)
incrTimestampMap
- timestamp mappublic ArrayList<BackupManifest.BackupImage> getRestoreDependentList(boolean reverse)
reverse
- If true, then output in reverse order, otherwise in time order from old to newpublic ArrayList<BackupManifest.BackupImage> getDependentListByTable(TableName table)
table
- tablepublic ArrayList<BackupManifest.BackupImage> getAllDependentListByTable(TableName table)
table
- tablepublic static boolean canCoverImage(BackupManifest.BackupImage image1, BackupManifest.BackupImage image2)
image1
- backup image 1image2
- backup image 2public static boolean canCoverImage(ArrayList<BackupManifest.BackupImage> fullImages, BackupManifest.BackupImage image)
fullImages
- The backup image setimage
- The target backup imagepublic BackupInfo toBackupInfo()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.