public class FileBlobStore extends AbstractBlobStore
AbstractBlobStore.BlockId, AbstractBlobStore.DataBLOCK_SIZE_LIMIT, HASH_ALGORITHM, inUse, TYPE_DATA, TYPE_HASH| Constructor and Description |
|---|
FileBlobStore(java.lang.String dir) |
| Modifier and Type | Method and 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.
|
protected boolean |
isMarkEnabled() |
protected void |
mark(AbstractBlobStore.BlockId id) |
protected byte[] |
readBlockFromBackend(AbstractBlobStore.BlockId id)
Load the block from the storage backend.
|
void |
startMark()
Start the mark phase.
|
protected void |
storeBlock(byte[] digest,
int level,
byte[] data)
Store a block of data.
|
int |
sweep()
Remove all unused blocks.
|
java.lang.String |
writeBlob(java.lang.String tempFilePath)
Write a blob from a temporary file.
|
clearInUse, close, deleteChunks, getBlobId, getBlobLength, getBlockSize, getBlockSizeMin, getInputStream, getOrCreateReferenceKey, getReference, getStatsCollector, load, mark, markInUse, readBlob, resolveChunks, setBlockSize, setBlockSizeMin, setReferenceKey, setReferenceKeyEncoded, setReferenceKeyPlainText, setStatsCollector, usesBlobId, writeBlob, writeBlobpublic java.lang.String writeBlob(java.lang.String tempFilePath)
throws java.io.IOException
GarbageCollectableBlobStorewriteBlob in interface GarbageCollectableBlobStorewriteBlob in class AbstractBlobStoretempFilePath - the temporary file namejava.io.IOExceptionprotected void storeBlock(byte[] digest,
int level,
byte[] data)
throws java.io.IOException
AbstractBlobStorestoreBlock in class AbstractBlobStoredigest - 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)java.io.IOExceptionprotected byte[] readBlockFromBackend(AbstractBlobStore.BlockId id) throws java.io.IOException
AbstractBlobStorereadBlockFromBackend in class AbstractBlobStoreid - the block idjava.io.IOExceptionpublic void startMark()
throws java.io.IOException
GarbageCollectableBlobStorestartMark in interface GarbageCollectableBlobStorestartMark in class AbstractBlobStorejava.io.IOExceptionprotected boolean isMarkEnabled()
isMarkEnabled in class AbstractBlobStoreprotected void mark(AbstractBlobStore.BlockId id) throws java.io.IOException
mark in class AbstractBlobStorejava.io.IOExceptionpublic int sweep()
throws java.io.IOException
GarbageCollectableBlobStoresweep in interface GarbageCollectableBlobStoresweep in class AbstractBlobStorejava.io.IOExceptionpublic long countDeleteChunks(java.util.List<java.lang.String> chunkIds,
long maxLastModifiedTime)
throws java.lang.Exception
GarbageCollectableBlobStorechunkIds - the chunk idsmaxLastModifiedTime - the max last modified time to consider for retrieval,
with the special value '0' meaning no filtering by timejava.lang.Exception - the exceptionpublic java.util.Iterator<java.lang.String> getAllChunkIds(long maxLastModifiedTime)
throws java.lang.Exception
GarbageCollectableBlobStoremaxLastModifiedTime - the max last modified time to consider for retrieval,
with the special value '0' meaning no filtering by timejava.lang.Exception - the exceptionpublic void clearCache()
GarbageCollectableBlobStoreCopyright © 2012–2022 The Apache Software Foundation. All rights reserved.