Class AbstractBackupRepository
- java.lang.Object
-
- org.apache.solr.core.backup.repository.AbstractBackupRepository
-
- All Implemented Interfaces:
Closeable,AutoCloseable,BackupRepository,NamedListInitializedPlugin
- Direct Known Subclasses:
LocalFileSystemRepository
public abstract class AbstractBackupRepository extends Object implements BackupRepository
AbstractBackupRepositoryimplementation providing some logic shared between real implementations.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.solr.core.backup.repository.BackupRepository
BackupRepository.PathType
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.solr.common.util.NamedList<?>configstatic StringPARAM_VERIFY_CHECKSUMPlugin initialization parameter to define whether theBackupRepositoryshould verify the checksum before copying index files.protected booleanshouldVerifyChecksum
-
Constructor Summary
Constructors Constructor Description AbstractBackupRepository()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopyIndexFileFrom(org.apache.lucene.store.Directory sourceDir, String sourceFileName, org.apache.lucene.store.Directory destDir, String destFileName)Copies an index file from a specifiedDirectoryto a destinationDirectory.protected static booleangetBooleanConfig(org.apache.solr.common.util.NamedList<?> args, String param, boolean defaultValue)voidinit(org.apache.solr.common.util.NamedList<?> args)initwill be called just once, immediately after creation.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.solr.core.backup.repository.BackupRepository
checksum, copyFileFrom, copyFileNoChecksum, copyFileTo, copyIndexFileFrom, copyIndexFileTo, createDirectory, createDirectoryURI, createOutput, createURI, delete, delete, deleteDirectory, exists, getBackupLocation, getConfigProperty, getPathType, listAll, listAllOrEmpty, openInput, resolve, resolveDirectory
-
-
-
-
Field Detail
-
PARAM_VERIFY_CHECKSUM
public static final String PARAM_VERIFY_CHECKSUM
Plugin initialization parameter to define whether theBackupRepositoryshould verify the checksum before copying index files. Defaults totrue.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:
- Constant Field Values
-
config
protected org.apache.solr.common.util.NamedList<?> config
-
shouldVerifyChecksum
protected boolean shouldVerifyChecksum
-
-
Method Detail
-
init
public void init(org.apache.solr.common.util.NamedList<?> args)
Description copied from interface:NamedListInitializedPlugininitwill 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:
initin interfaceNamedListInitializedPlugin- 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 IOExceptionCopies an index file from a specifiedDirectoryto a destinationDirectory. Also verifies the checksum unlessPARAM_VERIFY_CHECKSUMwas false in theinit(NamedList)arguments.- Specified by:
copyIndexFileFromin interfaceBackupRepository- Parameters:
sourceDir- The source directory hosting the file to be copied.sourceFileName- The name of the file to be copieddestDir- 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 fileCorruptIndexException- in case checksum of the file does not match with precomputed checksum stored at the end of the fileIOException
-
getBooleanConfig
protected static boolean getBooleanConfig(org.apache.solr.common.util.NamedList<?> args, String param, boolean defaultValue)
-
-