public class BackupFilePaths extends Object
Constructor and Description |
---|
BackupFilePaths(BackupRepository repository,
URI backupLoc)
Create a BackupFilePaths object.
|
Modifier and Type | Method and Description |
---|---|
static URI |
buildExistingBackupLocationURI(BackupRepository repository,
URI location,
String backupName)
Builds the URI for the backup location given the user-provided 'location' and backup 'name'.
|
void |
createIncrementalBackupFolders()
Create all locations required to store an incremental backup.
|
static List<BackupId> |
findAllBackupIdsFromFileListing(String[] listFiles)
Identify all strings which appear to be the filename of a top-level backup properties file.
|
static Optional<BackupId> |
findMostRecentBackupIdFromFileListing(String[] listFiles)
Identify the string from an array of filenames which represents the most recent top-level backup properties file.
|
URI |
getBackupLocation() |
static String |
getBackupPropsName(BackupId id)
Get the filename of the top-level backup properties file
Valid for both incremental and traditional backups.
|
URI |
getIndexDir()
Return a URI for the 'index' location, responsible for holding index files for all backups at this location.
|
URI |
getShardBackupMetadataDir()
Return a URI for the 'shard_backup_metadata' location, which contains metadata files about each shard backup.
|
static String |
getZkStateDir(BackupId id)
Get the directory name used to hold backed up ZK state
Valid for both incremental and traditional backups.
|
public BackupFilePaths(BackupRepository repository, URI backupLoc)
repository
- the repository; used primarily to resolve URIs.backupLoc
- the root location for a named backup. For traditional backups this is expected to take the form
baseLocation/backupName. For incremental backups this is expected to be of the form
baseLocation/backupName/collectionName.public URI getIndexDir()
public URI getShardBackupMetadataDir()
public URI getBackupLocation()
public void createIncrementalBackupFolders() throws IOException
IOException
- for issues encountered using repository to create directoriespublic static String getZkStateDir(BackupId id)
id
- the ID of the backup in questionpublic static String getBackupPropsName(BackupId id)
id
- the ID of the backup in questionpublic static List<BackupId> findAllBackupIdsFromFileListing(String[] listFiles)
listFiles
- a list of strings, filenames which may or may not correspond to backup properties filespublic static Optional<BackupId> findMostRecentBackupIdFromFileListing(String[] listFiles)
listFiles
- a list of strings, filenames which may or may not correspond to backup properties files.public static URI buildExistingBackupLocationURI(BackupRepository repository, URI location, String backupName) throws IOException
repository
- the backup repository, used to list files and resolve URI's.location
- a URI representing the repository location holding each backup namebackupName
- the specific backup name to create a URI forIOException
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.