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
AbstractBackupRepository
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
Fields Modifier and Type Field Description protected org.apache.solr.common.util.NamedList<?>
config
static String
PARAM_VERIFY_CHECKSUM
Plugin initialization parameter to define whether theBackupRepository
should verify the checksum before copying index files.protected boolean
shouldVerifyChecksum
-
Constructor Summary
Constructors Constructor Description AbstractBackupRepository()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
copyIndexFileFrom(org.apache.lucene.store.Directory sourceDir, String sourceFileName, org.apache.lucene.store.Directory destDir, String destFileName)
Copies an index file from a specifiedDirectory
to a destinationDirectory
.protected static boolean
getBooleanConfig(org.apache.solr.common.util.NamedList<?> args, String param, boolean defaultValue)
void
init(org.apache.solr.common.util.NamedList<?> args)
init
will 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 theBackupRepository
should 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: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 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 specifiedDirectory
to a destinationDirectory
. Also verifies the checksum unlessPARAM_VERIFY_CHECKSUM
was false in theinit(NamedList)
arguments.- Specified by:
copyIndexFileFrom
in 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)
-
-