Package org.apache.solr.core.backup
Class BackupManager
- java.lang.Object
-
- org.apache.solr.core.backup.BackupManager
-
public class BackupManager extends Object
This class implements functionality to create a backup with extension points provided to integrate with different types of file-systems.
-
-
Field Summary
Fields Modifier and Type Field Description static StringBACKUP_NAME_PROPstatic StringBACKUP_PROPS_FILEstatic StringCOLLECTION_ALIAS_PROPstatic StringCOLLECTION_NAME_PROPstatic StringCOLLECTION_PROPS_FILEstatic StringCONFIG_STATE_DIRstatic StringINDEX_VERSION_PROPprotected BackupRepositoryrepositorystatic StringSTART_TIME_PROPstatic StringZK_STATE_DIRprotected ZkStateReaderzkStateReader
-
Constructor Summary
Constructors Constructor Description BackupManager(BackupRepository repository, ZkStateReader zkStateReader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddownloadCollectionProperties(URI backupLoc, String backupId, String collectionName)voiddownloadConfigDir(URI backupLoc, String backupId, String configName)This method stores the contents of a specified Solr config at the specified location in repository.StringgetVersion()PropertiesreadBackupProperties(URI backupLoc, String backupId)This method returns the configuration parameters for the specified backup.DocCollectionreadCollectionState(URI backupLoc, String backupId, String collectionName)This method reads the meta-data information for the backed-up collection.voiduploadCollectionProperties(URI backupLoc, String backupId, String collectionName)voiduploadConfigDir(URI backupLoc, String backupId, String sourceConfigName, String targetConfigName)This method uploads the Solr configuration files to the desired location in Zookeeper.voidwriteBackupProperties(URI backupLoc, String backupId, Properties props)This method stores the backup properties at the specified location in the repository.voidwriteCollectionState(URI backupLoc, String backupId, String collectionName, DocCollection collectionState)This method writes the collection meta-data to the specified location in the repository.
-
-
-
Field Detail
-
COLLECTION_PROPS_FILE
public static final String COLLECTION_PROPS_FILE
- See Also:
- Constant Field Values
-
BACKUP_PROPS_FILE
public static final String BACKUP_PROPS_FILE
- See Also:
- Constant Field Values
-
ZK_STATE_DIR
public static final String ZK_STATE_DIR
- See Also:
- Constant Field Values
-
CONFIG_STATE_DIR
public static final String CONFIG_STATE_DIR
- See Also:
- Constant Field Values
-
COLLECTION_NAME_PROP
public static final String COLLECTION_NAME_PROP
- See Also:
- Constant Field Values
-
COLLECTION_ALIAS_PROP
public static final String COLLECTION_ALIAS_PROP
- See Also:
- Constant Field Values
-
BACKUP_NAME_PROP
public static final String BACKUP_NAME_PROP
- See Also:
- Constant Field Values
-
INDEX_VERSION_PROP
public static final String INDEX_VERSION_PROP
- See Also:
- Constant Field Values
-
START_TIME_PROP
public static final String START_TIME_PROP
- See Also:
- Constant Field Values
-
zkStateReader
protected final ZkStateReader zkStateReader
-
repository
protected final BackupRepository repository
-
-
Constructor Detail
-
BackupManager
public BackupManager(BackupRepository repository, ZkStateReader zkStateReader)
-
-
Method Detail
-
getVersion
public final String getVersion()
- Returns:
- The version of this backup implementation.
-
readBackupProperties
public Properties readBackupProperties(URI backupLoc, String backupId) throws IOException
This method returns the configuration parameters for the specified backup.- Parameters:
backupLoc- The base path used to store the backup data.backupId- The unique name for the backup whose configuration params are required.- Returns:
- the configuration parameters for the specified backup.
- Throws:
IOException- In case of errors.
-
writeBackupProperties
public void writeBackupProperties(URI backupLoc, String backupId, Properties props) throws IOException
This method stores the backup properties at the specified location in the repository.- Parameters:
backupLoc- The base path used to store the backup data.backupId- The unique name for the backup whose configuration params are required.props- The backup properties- Throws:
IOException- in case of I/O error
-
readCollectionState
public DocCollection readCollectionState(URI backupLoc, String backupId, String collectionName) throws IOException
This method reads the meta-data information for the backed-up collection.- Parameters:
backupLoc- The base path used to store the backup data.backupId- The unique name for the backup.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(URI backupLoc, String backupId, String collectionName, DocCollection collectionState) throws IOException
This method writes the collection meta-data to the specified location in the repository.- Parameters:
backupLoc- The base path used to store the backup data.backupId- The unique name for the backup.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(URI backupLoc, String backupId, String sourceConfigName, String targetConfigName) throws IOException
This method uploads the Solr configuration files to the desired location in Zookeeper.- Parameters:
backupLoc- The base path used to store the backup data.backupId- The unique name for the backup.sourceConfigName- The name of the config to be copiedtargetConfigName- The name of the config to be created.- Throws:
IOException- in case of I/O errors.
-
downloadConfigDir
public void downloadConfigDir(URI backupLoc, String backupId, String configName) throws IOException
This method stores the contents of a specified Solr config at the specified location in repository.- Parameters:
backupLoc- The base path used to store the backup data.backupId- The unique name for the backup.configName- The name of the config to be saved.- Throws:
IOException- in case of I/O errors.
-
uploadCollectionProperties
public void uploadCollectionProperties(URI backupLoc, String backupId, String collectionName) throws IOException
- Throws:
IOException
-
downloadCollectionProperties
public void downloadCollectionProperties(URI backupLoc, String backupId, String collectionName) throws IOException
- Throws:
IOException
-
-