Class AbstractBackupRepository

java.lang.Object
org.apache.solr.core.backup.repository.AbstractBackupRepository
All Implemented Interfaces:
Closeable, AutoCloseable, BackupRepository, NamedListInitializedPlugin
Direct Known Subclasses:
DelegatingBackupRepository, LocalFileSystemRepository

public abstract class AbstractBackupRepository extends Object implements BackupRepository
Abstract BackupRepository implementation providing some logic shared between real implementations.
  • Field Details

    • PARAM_VERIFY_CHECKSUM

      public static final String PARAM_VERIFY_CHECKSUM
      Plugin initialization parameter to define whether the BackupRepository should verify the checksum before copying index files. Defaults to true.

      If the checksum cannot be verified in the standard Lucene way (CodecUtil.checkFooter(org.apache.lucene.store.ChecksumIndexInput), then this parameter can be set to false, and the checksum should be verified in a specific way.

      See Also:
    • config

      protected org.apache.solr.common.util.NamedList<?> config
    • shouldVerifyChecksum

      protected boolean shouldVerifyChecksum
  • Constructor Details

    • AbstractBackupRepository

      public AbstractBackupRepository()
  • Method Details

    • init

      public void init(org.apache.solr.common.util.NamedList<?> args)
      Description copied from interface: NamedListInitializedPlugin
      init will be called just once, immediately after creation.

      Source of the initialization arguments will typically be solrconfig.xml, but will ultimately depends on the plugin itself

      Specified by:
      init in interface NamedListInitializedPlugin
      Parameters:
      args - non-null list of initialization parameters (may be empty)
    • copyIndexFileFrom

      public void copyIndexFileFrom(org.apache.lucene.store.Directory sourceDir, String sourceFileName, org.apache.lucene.store.Directory destDir, String destFileName) throws IOException
      Copies an index file from a specified Directory to a destination Directory. Also verifies the checksum unless PARAM_VERIFY_CHECKSUM was false in the init(NamedList) arguments.
      Specified by:
      copyIndexFileFrom in interface BackupRepository
      Parameters:
      sourceDir - The source directory hosting the file to be copied.
      sourceFileName - The name of the file to be copied
      destDir - The destination directory.
      Throws:
      org.apache.lucene.index.CorruptIndexException - in case checksum of the file does not match with precomputed checksum stored at the end of the file
      IOException
    • getBooleanConfig

      protected static boolean getBooleanConfig(org.apache.solr.common.util.NamedList<?> args, String param, boolean defaultValue)