Package org.apache.solr.core.backup
Class BackupFilePaths
java.lang.Object
org.apache.solr.core.backup.BackupFilePaths
Utility class for getting paths related to backups, or parsing information out of those paths.
-
Constructor Summary
ConstructorsConstructorDescriptionBackupFilePaths(BackupRepository repository, URI backupLoc) Create a BackupFilePaths object. -
Method Summary
Modifier and TypeMethodDescriptionstatic URIbuildExistingBackupLocationURI(BackupRepository repository, URI location, String backupName) Builds the URI for the backup location given the user-provided 'location' and backup 'name'.voidCreate all locations required to store an incremental backup.findAllBackupIdsFromFileListing(String[] listFiles) Identify all strings which appear to be the filename of a top-level backup properties file.findMostRecentBackupIdFromFileListing(String[] listFiles) Identify the string from an array of filenames which represents the most recent top-level backup properties file.static StringGet the filename of the top-level backup properties fileReturn a URI for the 'index' location, responsible for holding index files for all backups at this location.Return a URI for the 'shard_backup_metadata' location, which contains metadata files about each shard backup.static StringGet the directory name used to hold backed up ZK state
-
Constructor Details
-
BackupFilePaths
Create a BackupFilePaths object.- Parameters:
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.
-
-
Method Details
-
getIndexDir
Return a URI for the 'index' location, responsible for holding index files for all backups at this location.Only valid for incremental backups.
-
getShardBackupMetadataDir
Return a URI for the 'shard_backup_metadata' location, which contains metadata files about each shard backup.Only valid for incremental backups.
-
getBackupLocation
-
createIncrementalBackupFolders
Create all locations required to store an incremental backup.- Throws:
IOException- for issues encountered using repository to create directories
-
getZkStateDir
Get the directory name used to hold backed up ZK stateValid for both incremental and traditional backups.
- Parameters:
id- the ID of the backup in question
-
getBackupPropsName
Get the filename of the top-level backup properties fileValid for both incremental and traditional backups.
- Parameters:
id- the ID of the backup in question
-
findAllBackupIdsFromFileListing
Identify all strings which appear to be the filename of a top-level backup properties file.Only valid for incremental backups.
- Parameters:
listFiles- a list of strings, filenames which may or may not correspond to backup properties files
-
findMostRecentBackupIdFromFileListing
Identify the string from an array of filenames which represents the most recent top-level backup properties file.Only valid for incremental backups.
- Parameters:
listFiles- a list of strings, filenames which may or may not correspond to backup properties files.
-
buildExistingBackupLocationURI
public static URI buildExistingBackupLocationURI(BackupRepository repository, URI location, String backupName) throws IOException Builds the URI for the backup location given the user-provided 'location' and backup 'name'.- Parameters:
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 for- Throws:
IOException
-