Class 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.
    • Method Detail

      • forIncrementalBackup

        public static BackupManager forIncrementalBackup​(BackupRepository repository,
                                                         org.apache.solr.common.cloud.ZkStateReader stateReader,
                                                         URI backupPath)
      • getBackupId

        public final BackupId getBackupId()
      • getVersion

        public final String getVersion()
        Returns:
        The version of this backup implementation.
      • readBackupProperties

        public BackupProperties readBackupProperties()
                                              throws IOException
        This method returns the configuration parameters for the specified backup.
        Returns:
        the configuration parameters for the specified backup.
        Throws:
        IOException - In case of errors.
      • writeBackupProperties

        public void writeBackupProperties​(BackupProperties props)
                                   throws IOException
        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 copied
        targetConfigName - 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.