public class MongoBlobStore extends org.apache.jackrabbit.oak.plugins.blob.CachingBlobStore
CachingBlobStore. It saves blobs into a separate collection in
MongoDB (not using GridFS) and it supports basic garbage collection.
FIXME: -Do we need to create commands for retry etc.? -Not sure if this is
going to work for multiple MKs talking to same MongoDB?org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore.BlockId, org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore.Data| Modifier and Type | Field and Description |
|---|---|
static String |
COLLECTION_BLOBS |
blobCacheSize, cache, DEFAULT_CACHE_SIZE, MEM_CACHE_NAMEBLOCK_SIZE_LIMIT, HASH_ALGORITHM, inUse, TYPE_DATA, TYPE_HASH| Constructor and Description |
|---|
MongoBlobStore(com.mongodb.client.MongoDatabase db)
Constructs a new
MongoBlobStore |
MongoBlobStore(com.mongodb.client.MongoDatabase db,
long cacheSize) |
| Modifier and Type | Method and Description |
|---|---|
long |
countDeleteChunks(List<String> chunkIds,
long maxLastModifiedTime) |
Iterator<String> |
getAllChunkIds(long maxLastModifiedTime) |
protected boolean |
isMarkEnabled() |
protected void |
mark(org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore.BlockId blockId) |
protected byte[] |
readBlockFromBackend(org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore.BlockId blockId) |
void |
startMark() |
protected void |
storeBlock(byte[] digest,
int level,
byte[] data) |
int |
sweep() |
clearCache, getBlobCacheSize, getCacheStatsclearInUse, deleteChunks, getBlobId, getBlobLength, getBlockSize, getBlockSizeMin, getInputStream, getOrCreateReferenceKey, getReference, getStatsCollector, load, mark, markInUse, readBlob, resolveChunks, setBlockSize, setBlockSizeMin, setReferenceKey, setReferenceKeyEncoded, setReferenceKeyPlainText, setStatsCollector, usesBlobId, writeBlob, writeBlob, writeBlobpublic static final String COLLECTION_BLOBS
public MongoBlobStore(com.mongodb.client.MongoDatabase db)
MongoBlobStoredb - The DB.public MongoBlobStore(com.mongodb.client.MongoDatabase db,
long cacheSize)
protected void storeBlock(byte[] digest,
int level,
byte[] data)
throws IOException
storeBlock in class org.apache.jackrabbit.oak.spi.blob.AbstractBlobStoreIOExceptionprotected byte[] readBlockFromBackend(org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore.BlockId blockId) throws Exception
readBlockFromBackend in class org.apache.jackrabbit.oak.spi.blob.AbstractBlobStoreExceptionpublic void startMark()
throws IOException
startMark in interface org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStorestartMark in class org.apache.jackrabbit.oak.spi.blob.AbstractBlobStoreIOExceptionprotected boolean isMarkEnabled()
isMarkEnabled in class org.apache.jackrabbit.oak.spi.blob.AbstractBlobStoreprotected void mark(org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore.BlockId blockId) throws Exception
mark in class org.apache.jackrabbit.oak.spi.blob.AbstractBlobStoreExceptionpublic int sweep()
throws IOException
sweep in interface org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStoresweep in class org.apache.jackrabbit.oak.spi.blob.AbstractBlobStoreIOExceptionpublic long countDeleteChunks(List<String> chunkIds, long maxLastModifiedTime) throws Exception
ExceptionCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.