Package org.apache.solr.gcs
Class GCSBackupRepository
java.lang.Object
org.apache.solr.core.backup.repository.AbstractBackupRepository
org.apache.solr.gcs.GCSBackupRepository
- All Implemented Interfaces:
Closeable,AutoCloseable,BackupRepository,NamedListInitializedPlugin
BackupRepository implementation that stores files in Google Cloud Storage ("GCS").-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.solr.core.backup.repository.BackupRepository
BackupRepository.PathType -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringprotected intprotected com.google.cloud.storage.Storageprotected com.google.cloud.storage.StorageOptions.Builderprotected intFields inherited from class org.apache.solr.core.backup.repository.AbstractBackupRepository
config, PARAM_VERIFY_CHECKSUM, shouldVerifyChecksum -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<com.google.cloud.storage.BlobId> allBlobsAtDir(URI path) voidclose()voidcopyIndexFileFrom(org.apache.lucene.store.Directory sourceDir, String sourceFileName, URI destDir, String destFileName) voidcopyIndexFileTo(URI sourceRepo, String sourceFileName, org.apache.lucene.store.Directory dest, String destFileName) voidcreateDirectory(URI path) createDirectoryURI(String location) createOutput(URI path) voiddelete(URI path, Collection<String> files) voiddeleteDirectory(URI path) booleanboolean<T> TgetConfigProperty(String name) protected com.google.cloud.storage.Storage.BlobWriteOption[]getPathType(URI path) voidinit(org.apache.solr.common.util.NamedList<?> args) protected com.google.cloud.storage.StorageString[]org.apache.lucene.store.IndexInputresolveDirectory(URI baseUri, String... pathComponents) Methods inherited from class org.apache.solr.core.backup.repository.AbstractBackupRepository
copyIndexFileFrom, getBooleanConfigMethods 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, getBackupLocation, listAllOrEmpty
-
Field Details
-
storage
protected com.google.cloud.storage.Storage storage -
bucketName
-
credentialPath
-
writeBufferSizeBytes
protected int writeBufferSizeBytes -
readBufferSizeBytes
protected int readBufferSizeBytes -
storageOptionsBuilder
protected com.google.cloud.storage.StorageOptions.Builder storageOptionsBuilder
-
-
Constructor Details
-
GCSBackupRepository
public GCSBackupRepository()
-
-
Method Details
-
initStorage
protected com.google.cloud.storage.Storage initStorage() -
init
public void init(org.apache.solr.common.util.NamedList<?> args) - Specified by:
initin interfaceNamedListInitializedPlugin- Overrides:
initin classAbstractBackupRepository
-
getConfigProperty
-
createURI
-
createDirectoryURI
-
resolve
-
resolveDirectory
-
exists
- Throws:
IOException
-
exists
- Throws:
IOException
-
getPathType
- Throws:
IOException
-
listAll
- Throws:
IOException
-
openInput
public org.apache.lucene.store.IndexInput openInput(URI dirPath, String fileName, org.apache.lucene.store.IOContext ctx) throws IOException - Throws:
IOException
-
createOutput
- Throws:
IOException
-
createDirectory
- Throws:
IOException
-
deleteDirectory
- Throws:
IOException
-
allBlobsAtDir
- Throws:
IOException
-
delete
-
copyIndexFileFrom
public void copyIndexFileFrom(org.apache.lucene.store.Directory sourceDir, String sourceFileName, URI destDir, String destFileName) throws IOException - Throws:
IOException
-
copyIndexFileTo
public void copyIndexFileTo(URI sourceRepo, String sourceFileName, org.apache.lucene.store.Directory dest, String destFileName) throws IOException - Throws:
IOException
-
close
- Throws:
IOException
-
getDefaultBlobWriteOptions
protected com.google.cloud.storage.Storage.BlobWriteOption[] getDefaultBlobWriteOptions()
-