@InterfaceAudience.Private @InterfaceStability.Evolving public class BackupManifest extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
BackupManifest.BackupImage |
| Modifier and Type | Field and Description |
|---|---|
protected Configuration |
config |
static String |
MANIFEST_FILE_NAME |
static String |
MANIFEST_VERSION |
| Constructor and Description |
|---|
BackupManifest(BackupInfo backupCtx)
Construct manifest for a ongoing backup.
|
BackupManifest(BackupInfo backupCtx,
TableName table)
Construct a table level manifest for a backup of the named table.
|
BackupManifest(Configuration conf,
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.
|
Map<String,BackupManifest.BackupImage> |
getDependency()
Get all dependent backup images.
|
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,HashMap<String,Long>> |
getIncrTimestampMap() |
ArrayList<BackupManifest.BackupImage> |
getRestoreDependentList(boolean reverse)
Get the image list of this backup for restore in time order.
|
ArrayList<TableName> |
getTableList()
Get the table set of this image.
|
BackupType |
getType() |
String |
getVersion()
Get manifest file version
|
void |
setIncrTimestampMap(HashMap<TableName,HashMap<String,Long>> incrTimestampMap)
Set the incremental timestamp map directly.
|
void |
setType(BackupType type) |
void |
store(Configuration conf)
Persist the manifest file.
|
byte[] |
toByteArray()
Protobuf serialization
|
public static final String MANIFEST_FILE_NAME
public static final String MANIFEST_VERSION
protected Configuration config
public BackupManifest(BackupInfo backupCtx)
backupCtx - The ongoing backup contextpublic BackupManifest(BackupInfo backupCtx, TableName table)
backupCtx - The ongoing backup contextpublic BackupManifest(Configuration conf,
Path backupPath)
throws BackupException
conf - configurationbackupPath - backup pathBackupException - exceptionpublic BackupType getType()
public void setType(BackupType type)
public ArrayList<TableName> getTableList()
public void store(Configuration conf)
throws BackupException
IOException - IOException when storing the manifest file.BackupExceptionpublic byte[] toByteArray()
public String getVersion()
public BackupManifest.BackupImage getBackupImage()
public void addDependentImage(BackupManifest.BackupImage image)
image - The direct dependent backup imagepublic Map<String,BackupManifest.BackupImage> getDependency()
public void setIncrTimestampMap(HashMap<TableName,HashMap<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 image