Package org.apache.solr.core.backup
Class ShardBackupMetadata
java.lang.Object
org.apache.solr.core.backup.ShardBackupMetadata
Represents the shard-backup metadata file.
The shard-backup metadata file is responsible for holding information about a specific backup-point for a specific shard. This includes the full list of index files required to restore this shard to the backup-point, with pointers to where each lives in the repository.
Shard backup metadata files have names derived from an associated ShardBackupId, to
avoid conflicts between shards and backupIds.
Not used by the (now deprecated) traditional 'full-snapshot' backup format.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBackedFile(String uniqueFileName, String originalFileName, Checksum fileChecksum) voidaddBackedFile(ShardBackupMetadata.BackedFile backedFile) static ShardBackupMetadataempty()static ShardBackupMetadatafrom(BackupRepository repository, URI dir, ShardBackupId shardBackupId) Reads a shard metadata file from aBackupRepositoryand parses the result into aShardBackupMetadataintnumFiles()voidstore(BackupRepository repository, URI folderURI, ShardBackupId shardBackupId) Storing ShardBackupMetadata atfolderURIwith namefilename.long
-
Constructor Details
-
ShardBackupMetadata
public ShardBackupMetadata()
-
-
Method Details
-
addBackedFile
-
numFiles
public int numFiles() -
totalSize
public long totalSize() -
addBackedFile
-
getFile
-
listUniqueFileNames
-
empty
-
from
public static ShardBackupMetadata from(BackupRepository repository, URI dir, ShardBackupId shardBackupId) throws IOException Reads a shard metadata file from aBackupRepositoryand parses the result into aShardBackupMetadata- Parameters:
repository- the storage repository to read shard-metadata fromdir- URI for the 'shard_backup_metadata' directory of the backup to read fromshardBackupId- the ID of the shard metadata file to read- Returns:
- a ShardBackupMetadata object representing the provided 'shardBackupId' if it could be found in 'dir', null otherwise
- Throws:
IOException
-
store
public void store(BackupRepository repository, URI folderURI, ShardBackupId shardBackupId) throws IOException Storing ShardBackupMetadata atfolderURIwith namefilename. If a file already existed there, overwrite it.- Throws:
IOException
-
listOriginalFileNames
-