public class ShardBackupMetadata extends Object
ShardBackupId
, to avoid conflicts between
shards and backupIds.
Not used by the (now deprecated) traditional 'full-snapshot' backup format.Modifier and Type | Class and Description |
---|---|
static class |
ShardBackupMetadata.BackedFile |
Constructor and Description |
---|
ShardBackupMetadata() |
Modifier and Type | Method and Description |
---|---|
void |
addBackedFile(ShardBackupMetadata.BackedFile backedFile) |
void |
addBackedFile(String uniqueFileName,
String originalFileName,
Checksum fileChecksum) |
static ShardBackupMetadata |
empty() |
static ShardBackupMetadata |
from(BackupRepository repository,
URI dir,
ShardBackupId shardBackupId)
Reads a shard metadata file from a
BackupRepository and parses the result into a ShardBackupMetadata |
Optional<ShardBackupMetadata.BackedFile> |
getFile(String originalFileName) |
Collection<String> |
listOriginalFileNames() |
List<String> |
listUniqueFileNames() |
int |
numFiles() |
void |
store(BackupRepository repository,
URI folderURI,
ShardBackupId shardBackupId)
Storing ShardBackupMetadata at
folderURI with name filename . |
long |
totalSize() |
public void addBackedFile(String uniqueFileName, String originalFileName, Checksum fileChecksum)
public int numFiles()
public long totalSize()
public void addBackedFile(ShardBackupMetadata.BackedFile backedFile)
public Optional<ShardBackupMetadata.BackedFile> getFile(String originalFileName)
public static ShardBackupMetadata empty()
public static ShardBackupMetadata from(BackupRepository repository, URI dir, ShardBackupId shardBackupId) throws IOException
BackupRepository
and parses the result into a ShardBackupMetadata
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 readIOException
public void store(BackupRepository repository, URI folderURI, ShardBackupId shardBackupId) throws IOException
folderURI
with name filename
.
If a file already existed there, overwrite it.IOException
public Collection<String> listOriginalFileNames()
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.