org.apache.jackrabbit.oak.spi.blob
Interface GarbageCollectableBlobStore

All Superinterfaces:
BlobStore
All Known Implementing Classes:
AbstractBlobStore, FileBlobStore, MemoryBlobStore

public interface GarbageCollectableBlobStore
extends BlobStore

A blob store that supports garbage collection.


Method Summary
 void clearCache()
          Clear the cache.
 void clearInUse()
          Clear all objects marked as "transiently in use".
 boolean deleteChunks(List<String> chunkIds, long maxLastModifiedTime)
          Deletes the blobs with the given ids.
 Iterator<String> getAllChunkIds(long maxLastModifiedTime)
          Gets all the identifiers.
 long getBlockSizeMin()
          Get the minimum block size (if there is any).
 Iterator<String> resolveChunks(String blobId)
          Resolve chunks 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 startMark()
          Start the mark phase.
 int sweep()
          Remove all unused blocks.
 String writeBlob(String tempFileName)
          Write a blob from a temporary file.
 
Methods inherited from interface org.apache.jackrabbit.oak.spi.blob.BlobStore
getBlobId, getBlobLength, getInputStream, getReference, readBlob, writeBlob
 

Method Detail

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

String writeBlob(String tempFileName)
                 throws IOException
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

int sweep()
          throws IOException
Remove all unused blocks.

Returns:
the number of removed blocks
Throws:
IOException

startMark

void startMark()
               throws IOException
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

Iterator<String> getAllChunkIds(long maxLastModifiedTime)
                                throws Exception
Gets all the identifiers.

Parameters:
maxLastModifiedTime - the max last modified time to consider for retrieval
Returns:
the identifiers
Throws:
Exception - the exception

deleteChunks

boolean deleteChunks(List<String> chunkIds,
                     long maxLastModifiedTime)
                     throws Exception
Deletes the blobs with the given ids.

Parameters:
chunkIds - the chunk ids
maxLastModifiedTime - the max last modified time to consider for retrieval
Returns:
true, if successful
Throws:
Exception - the exception

resolveChunks

Iterator<String> resolveChunks(String blobId)
                               throws IOException
Resolve chunks from the given Id.

Parameters:
blobId - the blob id
Returns:
the iterator
Throws:
IOException - Signals that an I/O exception has occurred.


Copyright © 2012-2014 The Apache Software Foundation. All Rights Reserved.