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:
java.lang.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 theBlobStore
to store blobs in a cloud blob store.Extends
AbstractBlobStore
and 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 long
countDeleteChunks(java.util.List<java.lang.String> chunkIds, long maxLastModifiedTime)
void
deleteBucket()
Delete the cloud container and all its contents.java.lang.String
getAccessKey()
java.util.Iterator<java.lang.String>
getAllChunkIds(long maxLastModifiedTime)
protected java.lang.String
getCloudContainer()
java.lang.String
getCloudProvider()
java.lang.String
getSecretKey()
void
init()
Instantiates a connection to the cloud blob store.protected boolean
isMarkEnabled()
protected void
mark(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.void
setAccessKey(java.lang.String accessKey)
void
setCloudContainer(java.lang.String cloudContainer)
void
setCloudProvider(java.lang.String cloudProvider)
void
setSecretKey(java.lang.String secretKey)
void
startMark()
protected void
storeBlock(byte[] digest, int level, byte[] data)
Uploads the block to the cloud service.int
sweep()
-
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 java.lang.String getCloudContainer()
-
setCloudContainer
public void setCloudContainer(java.lang.String cloudContainer)
-
getAccessKey
public java.lang.String getAccessKey()
-
setAccessKey
public void setAccessKey(java.lang.String accessKey)
-
getSecretKey
public java.lang.String getSecretKey()
-
setSecretKey
public void setSecretKey(java.lang.String secretKey)
-
getCloudProvider
public java.lang.String getCloudProvider()
-
setCloudProvider
public void setCloudProvider(java.lang.String cloudProvider)
-
init
public void init() throws java.lang.Exception
Instantiates a connection to the cloud blob store.- Throws:
java.lang.Exception
- if an error occurs
-
storeBlock
protected void storeBlock(byte[] digest, int level, byte[] data) throws java.io.IOException
Uploads the block to the cloud service.- Specified by:
storeBlock
in classorg.apache.jackrabbit.oak.spi.blob.AbstractBlobStore
- Throws:
java.io.IOException
-
readBlockFromBackend
protected byte[] readBlockFromBackend(org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore.BlockId blockId) throws java.lang.Exception
Reads the data from the actual cloud service.- Specified by:
readBlockFromBackend
in classorg.apache.jackrabbit.oak.spi.blob.AbstractBlobStore
- Throws:
java.lang.Exception
-
deleteBucket
public void deleteBucket()
Delete the cloud container and all its contents.
-
startMark
public void startMark() throws java.io.IOException
- Specified by:
startMark
in interfaceorg.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStore
- Specified by:
startMark
in classorg.apache.jackrabbit.oak.spi.blob.AbstractBlobStore
- Throws:
java.io.IOException
-
mark
protected void mark(org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore.BlockId id) throws java.lang.Exception
- Specified by:
mark
in classorg.apache.jackrabbit.oak.spi.blob.AbstractBlobStore
- Throws:
java.lang.Exception
-
sweep
public int sweep() throws java.io.IOException
- Specified by:
sweep
in interfaceorg.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStore
- Specified by:
sweep
in classorg.apache.jackrabbit.oak.spi.blob.AbstractBlobStore
- Throws:
java.io.IOException
-
isMarkEnabled
protected boolean isMarkEnabled()
- Specified by:
isMarkEnabled
in classorg.apache.jackrabbit.oak.spi.blob.AbstractBlobStore
-
getAllChunkIds
public java.util.Iterator<java.lang.String> getAllChunkIds(long maxLastModifiedTime) throws java.lang.Exception
- Throws:
java.lang.Exception
-
countDeleteChunks
public long countDeleteChunks(java.util.List<java.lang.String> chunkIds, long maxLastModifiedTime) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-