public class BackupManager extends Object
Modifier and Type | Field and Description |
---|---|
static String |
BACKUP_NAME_PROP |
protected BackupId |
backupId |
protected URI |
backupPath |
static String |
COLLECTION_ALIAS_PROP |
static String |
COLLECTION_NAME_PROP |
static String |
COLLECTION_PROPS_FILE |
static String |
CONFIG_STATE_DIR |
protected String |
existingPropsFile |
static String |
INDEX_VERSION_PROP |
protected BackupRepository |
repository |
static String |
START_TIME_PROP |
static String |
TRADITIONAL_BACKUP_PROPS_FILE |
static String |
ZK_STATE_DIR |
protected ZkStateReader |
zkStateReader |
Modifier and Type | Method and Description |
---|---|
void |
downloadCollectionProperties(String collectionName) |
void |
downloadConfigDir(String configName)
This method stores the contents of a specified Solr config at the specified location in repository.
|
static BackupManager |
forBackup(BackupRepository repository,
ZkStateReader stateReader,
URI backupPath) |
static BackupManager |
forIncrementalBackup(BackupRepository repository,
ZkStateReader stateReader,
URI backupPath) |
static BackupManager |
forRestore(BackupRepository repository,
ZkStateReader stateReader,
URI backupPath) |
static BackupManager |
forRestore(BackupRepository repository,
ZkStateReader stateReader,
URI backupPath,
int bid) |
BackupId |
getBackupId() |
String |
getVersion() |
BackupProperties |
readBackupProperties()
This method returns the configuration parameters for the specified backup.
|
DocCollection |
readCollectionState(String collectionName)
This method reads the meta-data information for the backed-up collection.
|
Optional<BackupProperties> |
tryReadBackupProperties() |
void |
uploadCollectionProperties(String collectionName) |
void |
uploadConfigDir(String sourceConfigName,
String targetConfigName)
This method uploads the Solr configuration files to the desired location in Zookeeper.
|
void |
writeBackupProperties(BackupProperties props)
This method stores the backup properties at the specified location in the repository.
|
void |
writeCollectionState(String collectionName,
DocCollection collectionState)
This method writes the collection meta-data to the specified location in the repository.
|
public static final String COLLECTION_PROPS_FILE
public static final String TRADITIONAL_BACKUP_PROPS_FILE
public static final String ZK_STATE_DIR
public static final String CONFIG_STATE_DIR
public static final String COLLECTION_NAME_PROP
public static final String COLLECTION_ALIAS_PROP
public static final String BACKUP_NAME_PROP
public static final String INDEX_VERSION_PROP
public static final String START_TIME_PROP
protected final ZkStateReader zkStateReader
protected final BackupRepository repository
protected final BackupId backupId
protected final URI backupPath
protected final String existingPropsFile
public static BackupManager forIncrementalBackup(BackupRepository repository, ZkStateReader stateReader, URI backupPath)
public static BackupManager forBackup(BackupRepository repository, ZkStateReader stateReader, URI backupPath)
public static BackupManager forRestore(BackupRepository repository, ZkStateReader stateReader, URI backupPath, int bid) throws IOException
IOException
public static BackupManager forRestore(BackupRepository repository, ZkStateReader stateReader, URI backupPath) throws IOException
IOException
public final BackupId getBackupId()
public final String getVersion()
public BackupProperties readBackupProperties() throws IOException
IOException
- In case of errors.public Optional<BackupProperties> tryReadBackupProperties() throws IOException
IOException
public void writeBackupProperties(BackupProperties props) throws IOException
props
- The backup propertiesIOException
- in case of I/O errorpublic DocCollection readCollectionState(String collectionName) throws IOException
collectionName
- The name of the collection whose meta-data is to be returned.IOException
- in case of errors.public void writeCollectionState(String collectionName, DocCollection collectionState) throws IOException
collectionName
- The name of the collection whose meta-data is being stored.collectionState
- The collection meta-data to be stored.IOException
- in case of I/O errors.public void uploadConfigDir(String sourceConfigName, String targetConfigName) throws IOException
sourceConfigName
- The name of the config to be copiedtargetConfigName
- The name of the config to be created.IOException
- in case of I/O errors.public void downloadConfigDir(String configName) throws IOException
configName
- The name of the config to be saved.IOException
- in case of I/O errors.public void uploadCollectionProperties(String collectionName) throws IOException
IOException
public void downloadCollectionProperties(String collectionName) throws IOException
IOException
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.