Class RDBBlobStore
java.lang.Object
org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore
org.apache.jackrabbit.oak.plugins.blob.CachingBlobStore
org.apache.jackrabbit.oak.plugins.document.rdb.RDBBlobStore
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Cache.Backend<AbstractBlobStore.BlockId,
,AbstractBlobStore.Data> BlobStore
,GarbageCollectableBlobStore
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore
AbstractBlobStore.BlockId, AbstractBlobStore.Data
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected RDBConnectionHandler
protected static final int
protected String
protected String
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
ConstructorsConstructorDescriptionRDBBlobStore
(@NotNull DataSource ds) Creates a RDBBlobStore instance using the providedDataSource
using defaultDocumentNodeStoreBuilder
andRDBOptions
.RDBBlobStore
(@NotNull DataSource ds, @Nullable DocumentNodeStoreBuilder<?> builder, @Nullable RDBOptions options) Creates a RDBBlobStore instance using the providedDataSource
using the givenDocumentNodeStoreBuilder
andRDBOptions
.RDBBlobStore
(@NotNull DataSource ds, @Nullable RDBOptions options) Creates a RDBBlobStore instance using the providedDataSource
using defaultDocumentNodeStoreBuilder
and the givenRDBOptions
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
long
countDeleteChunks
(List<String> chunkIds, long maxLastModifiedTime) Deletes the blobs with the given ids.protected void
finalize()
getAllChunkIds
(long maxLastModifiedTime) Gets all the identifiers.protected boolean
protected void
mark
(AbstractBlobStore.BlockId blockId) protected byte[]
readBlockFromBackend
(byte[] digest) protected byte[]
Load the block from the storage backend.void
Start the mark phase.protected void
storeBlock
(byte[] digest, int level, byte[] data) Store a block of data.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, deleteChunks, getBlobId, getBlobLength, getBlockSize, getBlockSizeMin, getInputStream, getOrCreateReferenceKey, getReference, getStatsCollector, load, mark, markInUse, readBlob, resolveChunks, setBlockSize, setBlockSizeMin, setReferenceKey, setReferenceKeyEncoded, setReferenceKeyPlainText, setStatsCollector, usesBlobId, writeBlob, writeBlob, writeBlob
-
Field Details
-
IDSIZE
protected static final int IDSIZE -
ch
-
tnData
-
tnMeta
-
-
Constructor Details
-
RDBBlobStore
public RDBBlobStore(@NotNull @NotNull DataSource ds, @Nullable @Nullable DocumentNodeStoreBuilder<?> builder, @Nullable @Nullable RDBOptions options) Creates a RDBBlobStore instance using the providedDataSource
using the givenDocumentNodeStoreBuilder
andRDBOptions
. -
RDBBlobStore
Creates a RDBBlobStore instance using the providedDataSource
using defaultDocumentNodeStoreBuilder
and the givenRDBOptions
. -
RDBBlobStore
Creates a RDBBlobStore instance using the providedDataSource
using defaultDocumentNodeStoreBuilder
andRDBOptions
.
-
-
Method Details
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classAbstractBlobStore
-
finalize
-
storeBlock
Description copied from class:AbstractBlobStore
Store a block of data.- 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
- Throws:
Exception
-
readBlockFromBackend
Description copied from class:AbstractBlobStore
Load the block from the storage backend. Returns null if the block was not found.- Specified by:
readBlockFromBackend
in classAbstractBlobStore
- Parameters:
blockId
- the block id- Returns:
- the block data, or null
- Throws:
Exception
-
startMark
Description copied from interface:GarbageCollectableBlobStore
Start the mark phase.- Specified by:
startMark
in interfaceGarbageCollectableBlobStore
- Specified by:
startMark
in classAbstractBlobStore
- Throws:
IOException
-
isMarkEnabled
protected boolean isMarkEnabled()- Specified by:
isMarkEnabled
in classAbstractBlobStore
-
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
-
countDeleteChunks
Description copied from interface:GarbageCollectableBlobStore
Deletes the blobs with the given ids.- Specified by:
countDeleteChunks
in interfaceGarbageCollectableBlobStore
- 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
-
getAllChunkIds
Description copied from interface:GarbageCollectableBlobStore
Gets all the identifiers.- Specified by:
getAllChunkIds
in interfaceGarbageCollectableBlobStore
- 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
-