Class CloudBlobStore
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore
-
- org.apache.jackrabbit.oak.plugins.blob.CachingBlobStore
-
- org.apache.jackrabbit.oak.plugins.blob.cloud.CloudBlobStore
-
- All Implemented Interfaces:
AutoCloseable,org.apache.jackrabbit.oak.commons.cache.Cache.Backend<org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore.BlockId,org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore.Data>,org.apache.jackrabbit.oak.spi.blob.BlobStore,org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStore
public class CloudBlobStore extends CachingBlobStore
Implementation of theBlobStoreto store blobs in a cloud blob store.Extends
AbstractBlobStoreand breaks the the binary to chunks for easier management.
-
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.oak.plugins.blob.CachingBlobStore
blobCacheSize, cache, DEFAULT_CACHE_SIZE, MEM_CACHE_NAME
-
-
Constructor Summary
Constructors Constructor Description CloudBlobStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longcountDeleteChunks(List<String> chunkIds, long maxLastModifiedTime)voiddeleteBucket()Delete the cloud container and all its contents.StringgetAccessKey()Iterator<String>getAllChunkIds(long maxLastModifiedTime)protected StringgetCloudContainer()StringgetCloudProvider()StringgetSecretKey()voidinit()Instantiates a connection to the cloud blob store.protected booleanisMarkEnabled()protected voidmark(org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore.BlockId id)protected byte[]readBlockFromBackend(org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore.BlockId blockId)Reads the data from the actual cloud service.voidsetAccessKey(String accessKey)voidsetCloudContainer(String cloudContainer)voidsetCloudProvider(String cloudProvider)voidsetSecretKey(String secretKey)voidstartMark()protected voidstoreBlock(byte[] digest, int level, byte[] data)Uploads the block to the cloud service.intsweep()-
Methods inherited from class org.apache.jackrabbit.oak.plugins.blob.CachingBlobStore
clearCache, getBlobCacheSize, getCacheStats
-
Methods inherited from class org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore
clearInUse, close, deleteChunks, getBlobId, getBlobLength, getBlockSize, getBlockSizeMin, getInputStream, getOrCreateReferenceKey, getReference, getStatsCollector, load, mark, markInUse, readBlob, resolveChunks, setBlockSize, setBlockSizeMin, setReferenceKey, setReferenceKeyEncoded, setReferenceKeyPlainText, setStatsCollector, usesBlobId, writeBlob, writeBlob, writeBlob
-
-
-
-
Method Detail
-
getCloudContainer
protected String getCloudContainer()
-
setCloudContainer
public void setCloudContainer(String cloudContainer)
-
getAccessKey
public String getAccessKey()
-
setAccessKey
public void setAccessKey(String accessKey)
-
getSecretKey
public String getSecretKey()
-
setSecretKey
public void setSecretKey(String secretKey)
-
getCloudProvider
public String getCloudProvider()
-
setCloudProvider
public void setCloudProvider(String cloudProvider)
-
init
public void init() throws ExceptionInstantiates a connection to the cloud blob store.- Throws:
Exception- if an error occurs
-
storeBlock
protected void storeBlock(byte[] digest, int level, byte[] data) throws IOExceptionUploads the block to the cloud service.- Specified by:
storeBlockin classorg.apache.jackrabbit.oak.spi.blob.AbstractBlobStore- Throws:
IOException
-
readBlockFromBackend
protected byte[] readBlockFromBackend(org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore.BlockId blockId) throws ExceptionReads the data from the actual cloud service.- Specified by:
readBlockFromBackendin classorg.apache.jackrabbit.oak.spi.blob.AbstractBlobStore- Throws:
Exception
-
deleteBucket
public void deleteBucket()
Delete the cloud container and all its contents.
-
startMark
public void startMark() throws IOException- Specified by:
startMarkin interfaceorg.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStore- Specified by:
startMarkin classorg.apache.jackrabbit.oak.spi.blob.AbstractBlobStore- Throws:
IOException
-
mark
protected void mark(org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore.BlockId id) throws Exception- Specified by:
markin classorg.apache.jackrabbit.oak.spi.blob.AbstractBlobStore- Throws:
Exception
-
sweep
public int sweep() throws IOException- Specified by:
sweepin interfaceorg.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStore- Specified by:
sweepin classorg.apache.jackrabbit.oak.spi.blob.AbstractBlobStore- Throws:
IOException
-
isMarkEnabled
protected boolean isMarkEnabled()
- Specified by:
isMarkEnabledin classorg.apache.jackrabbit.oak.spi.blob.AbstractBlobStore
-
getAllChunkIds
public Iterator<String> getAllChunkIds(long maxLastModifiedTime) throws Exception
- Throws:
Exception
-
-