Interface GarbageCollectableBlobStore
- All Superinterfaces:
AutoCloseable
,BlobStore
- All Known Implementing Classes:
AbstractBlobStore
,CachingBlobStore
,DataStoreBlobStore
,FileBlobStore
,MemoryBlobStore
A blob store that supports garbage collection.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clear the cache.void
Clear all objects marked as "transiently in use".long
countDeleteChunks
(List<String> chunkIds, long maxLastModifiedTime) Deletes the blobs with the given ids.boolean
deleteChunks
(List<String> chunkIds, long maxLastModifiedTime) Deprecated.getAllChunkIds
(long maxLastModifiedTime) Gets all the identifiers.long
Get the minimum block size (if there is any).resolveChunks
(String blobId) Resolve chunks stored in the blob store from the given Id.void
setBlockSize
(int x) Set the block size used by this blob store, if the blob store splits binaries into blocks.void
Start the mark phase.int
sweep()
Remove all unused blocks.Write a blob from a temporary file.Methods inherited from interface java.lang.AutoCloseable
close
Methods inherited from interface org.apache.jackrabbit.oak.spi.blob.BlobStore
getBlobId, getBlobLength, getInputStream, getReference, readBlob, writeBlob, writeBlob
-
Method Details
-
setBlockSize
void setBlockSize(int x) Set the block size used by this blob store, if the blob store splits binaries into blocks. If not, this setting is ignored.- Parameters:
x
- the block size in bytes.
-
writeBlob
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.- Parameters:
tempFileName
- the temporary file name- Returns:
- the blob id
- Throws:
IOException
-
sweep
Remove all unused blocks.- Returns:
- the number of removed blocks
- Throws:
IOException
-
startMark
Start the mark phase.- Throws:
IOException
-
clearInUse
void clearInUse()Clear all objects marked as "transiently in use". -
clearCache
void clearCache()Clear the cache. -
getBlockSizeMin
long getBlockSizeMin()Get the minimum block size (if there is any).- Returns:
- the block size
-
getAllChunkIds
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
-
deleteChunks
Deprecated.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:
- true, if successful
- Throws:
Exception
- the exception
-
countDeleteChunks
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
-
resolveChunks
Resolve chunks stored in the blob store from the given Id. This will not return any chunks stored in-line in the id.- Parameters:
blobId
- the blob id- Returns:
- the iterator
- Throws:
IOException
- Signals that an I/O exception has occurred.
-