Class FileBlobStore
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore
-
- org.apache.jackrabbit.oak.spi.blob.FileBlobStore
-
- All Implemented Interfaces:
AutoCloseable,Cache.Backend<AbstractBlobStore.BlockId,AbstractBlobStore.Data>,BlobStore,GarbageCollectableBlobStore
public class FileBlobStore extends AbstractBlobStore
A file blob store.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore
AbstractBlobStore.BlockId, AbstractBlobStore.Data
-
-
Constructor Summary
Constructors Constructor Description FileBlobStore(String dir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearCache()Clear the cache.longcountDeleteChunks(List<String> chunkIds, long maxLastModifiedTime)Deletes the blobs with the given ids.Iterator<String>getAllChunkIds(long maxLastModifiedTime)Gets all the identifiers.voidstartMark()Start the mark phase.intsweep()Remove all unused blocks.StringwriteBlob(String tempFilePath)Write a blob from a temporary file.-
Methods inherited from class org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore
clearInUse, close, deleteChunks, getBlobId, getBlobLength, getBlockSize, getBlockSizeMin, getInputStream, getReference, load, readBlob, resolveChunks, setBlockSize, setBlockSizeMin, setReferenceKey, setReferenceKeyEncoded, setReferenceKeyPlainText, setStatsCollector, writeBlob, writeBlob
-
-
-
-
Constructor Detail
-
FileBlobStore
public FileBlobStore(String dir)
-
-
Method Detail
-
writeBlob
public String writeBlob(String tempFilePath) throws IOException
Description copied from interface:GarbageCollectableBlobStoreWrite a blob from a temporary file. The temporary file is removed afterwards. A file based blob stores might simply rename the file, so that no additional writes are necessary.- Specified by:
writeBlobin interfaceGarbageCollectableBlobStore- Overrides:
writeBlobin classAbstractBlobStore- Parameters:
tempFilePath- the temporary file name- Returns:
- the blob id
- Throws:
IOException
-
startMark
public void startMark() throws IOExceptionDescription copied from interface:GarbageCollectableBlobStoreStart the mark phase.- Specified by:
startMarkin interfaceGarbageCollectableBlobStore- Specified by:
startMarkin classAbstractBlobStore- Throws:
IOException
-
sweep
public int sweep() throws IOExceptionDescription copied from interface:GarbageCollectableBlobStoreRemove all unused blocks.- Specified by:
sweepin interfaceGarbageCollectableBlobStore- Specified by:
sweepin classAbstractBlobStore- Returns:
- the number of removed blocks
- Throws:
IOException
-
countDeleteChunks
public long countDeleteChunks(List<String> chunkIds, long maxLastModifiedTime) throws Exception
Description copied from interface:GarbageCollectableBlobStoreDeletes 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
-
getAllChunkIds
public Iterator<String> getAllChunkIds(long maxLastModifiedTime) throws Exception
Description copied from interface:GarbageCollectableBlobStoreGets 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
-
clearCache
public void clearCache()
Description copied from interface:GarbageCollectableBlobStoreClear the cache.
-
-