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
,Cache.Backend<AbstractBlobStore.BlockId,
,AbstractBlobStore.Data> BlobStore
,GarbageCollectableBlobStore
Implementation of the
BlobStore
to store blobs in a cloud blob store.
Extends AbstractBlobStore
and breaks the the binary to chunks for easier management.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore
AbstractBlobStore.BlockId, AbstractBlobStore.Data
-
Field Summary
Fields inherited from class org.apache.jackrabbit.oak.plugins.blob.CachingBlobStore
blobCacheSize, cache, DEFAULT_CACHE_SIZE, MEM_CACHE_NAME
Fields inherited from class org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore
BLOCK_SIZE_LIMIT, HASH_ALGORITHM, inUse, TYPE_DATA, TYPE_HASH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
countDeleteChunks
(List<String> chunkIds, long maxLastModifiedTime) Deletes the blobs with the given ids.void
Delete the cloud container and all its contents.getAllChunkIds
(long maxLastModifiedTime) Gets all the identifiers.protected String
void
init()
Instantiates a connection to the cloud blob store.protected boolean
protected void
protected byte[]
Reads the data from the actual cloud service.void
setAccessKey
(String accessKey) void
setCloudContainer
(String cloudContainer) void
setCloudProvider
(String cloudProvider) void
setSecretKey
(String secretKey) void
Start the mark phase.protected void
storeBlock
(byte[] digest, int level, byte[] data) Uploads the block to the cloud service.int
sweep()
Remove all unused blocks.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
-
Constructor Details
-
CloudBlobStore
public CloudBlobStore()
-
-
Method Details
-
getCloudContainer
-
setCloudContainer
-
getAccessKey
-
setAccessKey
-
getSecretKey
-
setSecretKey
-
getCloudProvider
-
setCloudProvider
-
init
Instantiates a connection to the cloud blob store.- Throws:
Exception
- if an error occurs
-
storeBlock
Uploads the block to the cloud service.- Specified by:
storeBlock
in classAbstractBlobStore
- Parameters:
digest
- the content hash (32 bytes)level
- the indirection level (0 is for user data, 1 is a list of digests that point to user data, 2 is a list of digests that point to digests, and so on). This parameter is for informational use only, and it is not required to store it unless that's easy to achievedata
- the data to be stored (the number of bytes is at most the block size)- Throws:
IOException
-
readBlockFromBackend
Reads the data from the actual cloud service.- Specified by:
readBlockFromBackend
in classAbstractBlobStore
- Parameters:
blockId
- the block id- Returns:
- the block data, or null
- Throws:
Exception
-
deleteBucket
public void deleteBucket()Delete the cloud container and all its contents. -
startMark
Description copied from interface:GarbageCollectableBlobStore
Start the mark phase.- Specified by:
startMark
in interfaceGarbageCollectableBlobStore
- Specified by:
startMark
in classAbstractBlobStore
- Throws:
IOException
-
mark
- Specified by:
mark
in classAbstractBlobStore
- Throws:
Exception
-
sweep
Description copied from interface:GarbageCollectableBlobStore
Remove all unused blocks.- Specified by:
sweep
in interfaceGarbageCollectableBlobStore
- Specified by:
sweep
in classAbstractBlobStore
- Returns:
- the number of removed blocks
- Throws:
IOException
-
isMarkEnabled
protected boolean isMarkEnabled()- Specified by:
isMarkEnabled
in classAbstractBlobStore
-
getAllChunkIds
Description copied from interface:GarbageCollectableBlobStore
Gets all the identifiers.- Parameters:
maxLastModifiedTime
- the max last modified time to consider for retrieval, with the special value '0' meaning no filtering by time- Returns:
- the identifiers
- Throws:
Exception
- the exception
-
countDeleteChunks
Description copied from interface:GarbageCollectableBlobStore
Deletes the blobs with the given ids.- Parameters:
chunkIds
- the chunk idsmaxLastModifiedTime
- the max last modified time to consider for retrieval, with the special value '0' meaning no filtering by time- Returns:
- long the count of successful deletions
- Throws:
Exception
- the exception
-