Package org.apache.solr.core.backup
Class BackupManager
java.lang.Object
org.apache.solr.core.backup.BackupManager
This class implements functionality to create a backup with extension points provided to
integrate with different types of file-systems.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected final BackupIdprotected final URIstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected final Stringstatic final Stringprotected final BackupRepositorystatic final Stringstatic final Stringstatic final Stringprotected final org.apache.solr.common.cloud.ZkStateReader -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddownloadCollectionProperties(String collectionName) voiddownloadConfigDir(String configName, ConfigSetService configSetService) This method stores the contents of a specified Solr config at the specified location in repository.static BackupManagerforBackup(BackupRepository repository, org.apache.solr.common.cloud.ZkStateReader stateReader, URI backupPath) static BackupManagerforIncrementalBackup(BackupRepository repository, org.apache.solr.common.cloud.ZkStateReader stateReader, URI backupPath) static BackupManagerforRestore(BackupRepository repository, org.apache.solr.common.cloud.ZkStateReader stateReader, URI backupPath) static BackupManagerforRestore(BackupRepository repository, org.apache.solr.common.cloud.ZkStateReader stateReader, URI backupPath, int bid) final BackupIdfinal StringThis method returns the configuration parameters for the specified backup.org.apache.solr.common.cloud.DocCollectionreadCollectionState(String collectionName) This method reads the meta-data information for the backed-up collection.voiduploadCollectionProperties(String collectionName) voiduploadConfigDir(String sourceConfigName, String targetConfigName, ConfigSetService configSetService) This method uploads the Solr configuration files to the desired location in Zookeeper.voidThis method stores the backup properties at the specified location in the repository.voidwriteCollectionState(String collectionName, org.apache.solr.common.cloud.DocCollection collectionState) This method writes the collection meta-data to the specified location in the repository.
-
Field Details
-
COLLECTION_PROPS_FILE
- See Also:
-
TRADITIONAL_BACKUP_PROPS_FILE
- See Also:
-
ZK_STATE_DIR
- See Also:
-
CONFIG_STATE_DIR
- See Also:
-
COLLECTION_NAME_PROP
- See Also:
-
COLLECTION_ALIAS_PROP
- See Also:
-
BACKUP_NAME_PROP
- See Also:
-
INDEX_VERSION_PROP
- See Also:
-
START_TIME_PROP
- See Also:
-
END_TIME_PROP
- See Also:
-
zkStateReader
protected final org.apache.solr.common.cloud.ZkStateReader zkStateReader -
repository
-
backupId
-
backupPath
-
existingPropsFile
-
-
Method Details
-
forIncrementalBackup
public static BackupManager forIncrementalBackup(BackupRepository repository, org.apache.solr.common.cloud.ZkStateReader stateReader, URI backupPath) -
forBackup
public static BackupManager forBackup(BackupRepository repository, org.apache.solr.common.cloud.ZkStateReader stateReader, URI backupPath) -
forRestore
public static BackupManager forRestore(BackupRepository repository, org.apache.solr.common.cloud.ZkStateReader stateReader, URI backupPath, int bid) throws IOException - Throws:
IOException
-
forRestore
public static BackupManager forRestore(BackupRepository repository, org.apache.solr.common.cloud.ZkStateReader stateReader, URI backupPath) throws IOException - Throws:
IOException
-
getBackupId
-
getVersion
- Returns:
- The version of this backup implementation.
-
readBackupProperties
This method returns the configuration parameters for the specified backup.- Returns:
- the configuration parameters for the specified backup.
- Throws:
IOException- In case of errors.
-
tryReadBackupProperties
- Throws:
IOException
-
writeBackupProperties
This method stores the backup properties at the specified location in the repository.- Parameters:
props- The backup properties- Throws:
IOException- in case of I/O error
-
readCollectionState
public org.apache.solr.common.cloud.DocCollection readCollectionState(String collectionName) throws IOException This method reads the meta-data information for the backed-up collection.- Parameters:
collectionName- The name of the collection whose meta-data is to be returned.- Returns:
- the meta-data information for the backed-up collection.
- Throws:
IOException- in case of errors.
-
writeCollectionState
public void writeCollectionState(String collectionName, org.apache.solr.common.cloud.DocCollection collectionState) throws IOException This method writes the collection meta-data to the specified location in the repository.- Parameters:
collectionName- The name of the collection whose meta-data is being stored.collectionState- The collection meta-data to be stored.- Throws:
IOException- in case of I/O errors.
-
uploadConfigDir
public void uploadConfigDir(String sourceConfigName, String targetConfigName, ConfigSetService configSetService) throws IOException This method uploads the Solr configuration files to the desired location in Zookeeper.- Parameters:
sourceConfigName- The name of the config to be copiedtargetConfigName- The name of the config to be created.configSetService- The name of the configset used to upload the config- Throws:
IOException- in case of I/O errors.
-
downloadConfigDir
public void downloadConfigDir(String configName, ConfigSetService configSetService) throws IOException This method stores the contents of a specified Solr config at the specified location in repository.- Parameters:
configName- The name of the config to be saved.configSetService- The name of the configset used to download the config- Throws:
IOException- in case of I/O errors.
-
uploadCollectionProperties
- Throws:
IOException
-
downloadCollectionProperties
- Throws:
IOException
-
createZkStateDir
- Throws:
IOException
-