Package org.apache.solr.gcs
Class GCSBackupRepository
- java.lang.Object
- 
- org.apache.solr.gcs.GCSBackupRepository
 
- 
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- BackupRepository,- NamedListInitializedPlugin
 
 public class GCSBackupRepository extends Object implements BackupRepository BackupRepositoryimplementation that stores files in Google Cloud Storage ("GCS").
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.apache.solr.core.backup.repository.BackupRepositoryBackupRepository.PathType
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected StringbucketNameprotected StringcredentialPathprotected intreadBufferSizeBytesprotected com.google.cloud.storage.Storagestorageprotected com.google.cloud.storage.StorageOptions.BuilderstorageOptionsBuilderprotected intwriteBufferSizeBytes
 - 
Constructor SummaryConstructors Constructor Description GCSBackupRepository()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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)URIcreateDirectoryURI(String location)OutputStreamcreateOutput(URI path)URIcreateURI(String location)voiddelete(URI path, Collection<String> files)voiddeleteDirectory(URI path)booleanexists(String path)booleanexists(URI path)<T> TgetConfigProperty(String name)protected com.google.cloud.storage.Storage.BlobWriteOption[]getDefaultBlobWriteOptions()BackupRepository.PathTypegetPathType(URI path)voidinit(org.apache.solr.common.util.NamedList<?> args)protected com.google.cloud.storage.StorageinitStorage()String[]listAll(URI path)org.apache.lucene.store.IndexInputopenInput(URI dirPath, String fileName, org.apache.lucene.store.IOContext ctx)URIresolve(URI baseUri, String... pathComponents)URIresolveDirectory(URI baseUri, String... pathComponents)- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.solr.core.backup.repository.BackupRepositorychecksum, copyFileFrom, copyFileTo, copyIndexFileFrom, delete, getBackupLocation, listAllOrEmpty
 
- 
 
- 
- 
- 
Field Detail- 
storageprotected com.google.cloud.storage.Storage storage 
 - 
bucketNameprotected String bucketName 
 - 
credentialPathprotected String credentialPath 
 - 
writeBufferSizeBytesprotected int writeBufferSizeBytes 
 - 
readBufferSizeBytesprotected int readBufferSizeBytes 
 - 
storageOptionsBuilderprotected com.google.cloud.storage.StorageOptions.Builder storageOptionsBuilder 
 
- 
 - 
Method Detail- 
initStorageprotected com.google.cloud.storage.Storage initStorage() 
 - 
initpublic void init(org.apache.solr.common.util.NamedList<?> args) - Specified by:
- initin interface- NamedListInitializedPlugin
 
 - 
getConfigPropertypublic <T> T getConfigProperty(String name) - Specified by:
- getConfigPropertyin interface- BackupRepository
 
 - 
createURIpublic URI createURI(String location) - Specified by:
- createURIin interface- BackupRepository
 
 - 
createDirectoryURIpublic URI createDirectoryURI(String location) - Specified by:
- createDirectoryURIin interface- BackupRepository
 
 - 
resolvepublic URI resolve(URI baseUri, String... pathComponents) - Specified by:
- resolvein interface- BackupRepository
 
 - 
resolveDirectorypublic URI resolveDirectory(URI baseUri, String... pathComponents) - Specified by:
- resolveDirectoryin interface- BackupRepository
 
 - 
existspublic boolean exists(URI path) throws IOException - Specified by:
- existsin interface- BackupRepository
- Throws:
- IOException
 
 - 
existspublic boolean exists(String path) throws IOException - Throws:
- IOException
 
 - 
getPathTypepublic BackupRepository.PathType getPathType(URI path) throws IOException - Specified by:
- getPathTypein interface- BackupRepository
- Throws:
- IOException
 
 - 
listAllpublic String[] listAll(URI path) throws IOException - Specified by:
- listAllin interface- BackupRepository
- Throws:
- IOException
 
 - 
openInputpublic org.apache.lucene.store.IndexInput openInput(URI dirPath, String fileName, org.apache.lucene.store.IOContext ctx) throws IOException - Specified by:
- openInputin interface- BackupRepository
- Throws:
- IOException
 
 - 
createOutputpublic OutputStream createOutput(URI path) throws IOException - Specified by:
- createOutputin interface- BackupRepository
- Throws:
- IOException
 
 - 
createDirectorypublic void createDirectory(URI path) throws IOException - Specified by:
- createDirectoryin interface- BackupRepository
- Throws:
- IOException
 
 - 
deleteDirectorypublic void deleteDirectory(URI path) throws IOException - Specified by:
- deleteDirectoryin interface- BackupRepository
- Throws:
- IOException
 
 - 
allBlobsAtDirprotected List<com.google.cloud.storage.BlobId> allBlobsAtDir(URI path) throws IOException - Throws:
- IOException
 
 - 
deletepublic void delete(URI path, Collection<String> files) - Specified by:
- deletein interface- BackupRepository
 
 - 
copyIndexFileFrompublic void copyIndexFileFrom(org.apache.lucene.store.Directory sourceDir, String sourceFileName, URI destDir, String destFileName) throws IOException- Specified by:
- copyIndexFileFromin interface- BackupRepository
- Throws:
- IOException
 
 - 
copyIndexFileTopublic void copyIndexFileTo(URI sourceRepo, String sourceFileName, org.apache.lucene.store.Directory dest, String destFileName) throws IOException - Specified by:
- copyIndexFileToin interface- BackupRepository
- Throws:
- IOException
 
 - 
closepublic void close() throws IOException- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Throws:
- IOException
 
 - 
getDefaultBlobWriteOptionsprotected com.google.cloud.storage.Storage.BlobWriteOption[] getDefaultBlobWriteOptions() 
 
- 
 
-