Class AbstractBackupRepository
java.lang.Object
org.apache.solr.core.backup.repository.AbstractBackupRepository
- All Implemented Interfaces:
Closeable,AutoCloseable,BackupRepository,NamedListInitializedPlugin
- Direct Known Subclasses:
DelegatingBackupRepository,LocalFileSystemRepository
Abstract
BackupRepository implementation 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
FieldsModifier and TypeFieldDescriptionprotected org.apache.solr.common.util.NamedList<?> static final StringPlugin initialization parameter to define whether theBackupRepositoryshould verify the checksum before copying index files.protected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcopyIndexFileFrom(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, waitMethods inherited from interface org.apache.solr.core.backup.repository.BackupRepository
checksum, copyFileFrom, copyFileNoChecksum, copyFileTo, copyIndexFileFrom, copyIndexFileTo, createDirectory, createDirectoryURI, createOutput, createURI, delete, deleteDirectory, exists, getBackupLocation, getConfigProperty, getPathType, listAll, listAllOrEmpty, openInput, resolve, resolveDirectory
-
Field Details
-
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:
-
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: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 IOException Copies 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 fileIOException
-
getBooleanConfig
protected static boolean getBooleanConfig(org.apache.solr.common.util.NamedList<?> args, String param, boolean defaultValue)
-