Class FileBlobStore
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.blob.AbstractBlobStore
-
- org.apache.jackrabbit.oak.spi.blob.FileBlobStore
-
- All Implemented Interfaces:
java.lang.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(java.lang.String dir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearCache()
Clear the cache.long
countDeleteChunks(java.util.List<java.lang.String> chunkIds, long maxLastModifiedTime)
Deletes the blobs with the given ids.java.util.Iterator<java.lang.String>
getAllChunkIds(long maxLastModifiedTime)
Gets all the identifiers.void
startMark()
Start the mark phase.int
sweep()
Remove all unused blocks.java.lang.String
writeBlob(java.lang.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
-
-
-
-
Method Detail
-
writeBlob
public java.lang.String writeBlob(java.lang.String tempFilePath) throws java.io.IOException
Description copied from interface:GarbageCollectableBlobStore
Write 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:
writeBlob
in interfaceGarbageCollectableBlobStore
- Overrides:
writeBlob
in classAbstractBlobStore
- Parameters:
tempFilePath
- the temporary file name- Returns:
- the blob id
- Throws:
java.io.IOException
-
startMark
public void startMark() throws java.io.IOException
Description copied from interface:GarbageCollectableBlobStore
Start the mark phase.- Specified by:
startMark
in interfaceGarbageCollectableBlobStore
- Specified by:
startMark
in classAbstractBlobStore
- Throws:
java.io.IOException
-
sweep
public int sweep() throws java.io.IOException
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:
java.io.IOException
-
countDeleteChunks
public long countDeleteChunks(java.util.List<java.lang.String> chunkIds, long maxLastModifiedTime) throws java.lang.Exception
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:
java.lang.Exception
- the exception
-
getAllChunkIds
public java.util.Iterator<java.lang.String> getAllChunkIds(long maxLastModifiedTime) throws java.lang.Exception
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:
java.lang.Exception
- the exception
-
clearCache
public void clearCache()
Description copied from interface:GarbageCollectableBlobStore
Clear the cache.
-
-