public class DataStoreBlobStore extends Object implements DataStore, org.apache.jackrabbit.oak.spi.blob.BlobStore, org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStore, BlobTrackingStore, TypedDataStore
DataStore.getMinRecordLength()| Modifier and Type | Class and Description |
|---|---|
static class |
DataStoreBlobStore.BlobId |
SharedDataStore.Type| Modifier and Type | Field and Description |
|---|---|
protected com.google.common.cache.LoadingCache<String,byte[]> |
cache |
static int |
DEFAULT_CACHE_SIZE |
protected DataStore |
delegate |
static String |
MEM_CACHE_NAME |
protected org.apache.jackrabbit.oak.spi.blob.stats.BlobStatsCollector |
stats |
| Constructor and Description |
|---|
DataStoreBlobStore(DataStore delegate) |
DataStoreBlobStore(DataStore delegate,
boolean encodeLengthInId) |
DataStoreBlobStore(DataStore delegate,
boolean encodeLengthInId,
int cacheSizeInMB) |
protected final DataStore delegate
protected org.apache.jackrabbit.oak.spi.blob.stats.BlobStatsCollector stats
protected final com.google.common.cache.LoadingCache<String,byte[]> cache
public static final int DEFAULT_CACHE_SIZE
public static final String MEM_CACHE_NAME
public DataStoreBlobStore(DataStore delegate)
public DataStoreBlobStore(DataStore delegate, boolean encodeLengthInId)
public DataStoreBlobStore(DataStore delegate, boolean encodeLengthInId, int cacheSizeInMB)
public DataRecord getRecordIfStored(DataIdentifier identifier) throws DataStoreException
getRecordIfStored in interface DataStoreDataStoreExceptionpublic DataRecord getRecord(DataIdentifier identifier) throws DataStoreException
getRecord in interface DataStoreDataStoreExceptionpublic DataRecord getRecordFromReference(String reference) throws DataStoreException
getRecordFromReference in interface DataStoreDataStoreExceptionpublic DataRecord addRecord(InputStream stream) throws DataStoreException
addRecord in interface DataStoreDataStoreExceptionpublic void updateModifiedDateOnAccess(long before)
updateModifiedDateOnAccess in interface DataStorepublic int deleteAllOlderThan(long min)
throws DataStoreException
deleteAllOlderThan in interface DataStoreDataStoreExceptionpublic Iterator<DataIdentifier> getAllIdentifiers() throws DataStoreException
getAllIdentifiers in interface DataStoreDataStoreExceptionpublic void init(String homeDir) throws RepositoryException
init in interface DataStoreRepositoryExceptionpublic int getMinRecordLength()
getMinRecordLength in interface DataStorepublic void close()
throws DataStoreException
close in interface DataStoreDataStoreExceptionpublic String writeBlob(InputStream stream) throws IOException
writeBlob in interface org.apache.jackrabbit.oak.spi.blob.BlobStoreIOExceptionpublic String writeBlob(InputStream stream, org.apache.jackrabbit.oak.spi.blob.BlobOptions options) throws IOException
writeBlob in interface org.apache.jackrabbit.oak.spi.blob.BlobStoreIOExceptionpublic int readBlob(String encodedBlobId, long pos, byte[] buff, int off, int length) throws IOException
readBlob in interface org.apache.jackrabbit.oak.spi.blob.BlobStoreIOExceptionpublic long getBlobLength(String encodedBlobId) throws IOException
getBlobLength in interface org.apache.jackrabbit.oak.spi.blob.BlobStoreIOExceptionpublic String getBlobId(@Nonnull String reference)
getBlobId in interface org.apache.jackrabbit.oak.spi.blob.BlobStorepublic String getReference(@Nonnull String encodedBlobId)
getReference in interface org.apache.jackrabbit.oak.spi.blob.BlobStorepublic InputStream getInputStream(String encodedBlobId) throws IOException
getInputStream in interface org.apache.jackrabbit.oak.spi.blob.BlobStoreIOExceptionpublic void setBlockSize(int x)
setBlockSize in interface org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStorepublic String writeBlob(String tempFileName) throws IOException
writeBlob in interface org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStoreIOExceptionpublic int sweep()
throws IOException
sweep in interface org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStoreIOExceptionpublic void startMark()
throws IOException
startMark in interface org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStoreIOExceptionpublic void clearInUse()
clearInUse in interface DataStoreclearInUse in interface org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStorepublic void clearCache()
clearCache in interface org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStorepublic long getBlockSizeMin()
getBlockSizeMin in interface org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStorepublic Iterator<String> getAllChunkIds(long maxLastModifiedTime) throws Exception
getAllChunkIds in interface org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStoreExceptionpublic boolean deleteChunks(List<String> chunkIds, long maxLastModifiedTime) throws Exception
deleteChunks in interface org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStoreExceptionpublic long countDeleteChunks(List<String> chunkIds, long maxLastModifiedTime) throws Exception
countDeleteChunks in interface org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStoreExceptionpublic Iterator<String> resolveChunks(String blobId) throws IOException
resolveChunks in interface org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStoreIOExceptionpublic void addMetadataRecord(InputStream stream, String name) throws DataStoreException
SharedDataStoreaddMetadataRecord in interface SharedDataStorestream - the streamname - the name of the root recordDataStoreException - the data store exceptionpublic void addMetadataRecord(File f, String name) throws DataStoreException
SharedDataStoreaddMetadataRecord in interface SharedDataStoref - the filename - the name of the root recordDataStoreException - the data store exceptionpublic DataRecord getMetadataRecord(String name)
SharedDataStoregetMetadataRecord in interface SharedDataStorename - the name of the recordpublic List<DataRecord> getAllMetadataRecords(String prefix)
SharedDataStoregetAllMetadataRecords in interface SharedDataStorepublic boolean deleteMetadataRecord(String name)
SharedDataStoredeleteMetadataRecord in interface SharedDataStorename - the name of the root recordpublic void deleteAllMetadataRecords(String prefix)
SharedDataStoredeleteAllMetadataRecords in interface SharedDataStoreprefix - metadata type identifierpublic Iterator<DataRecord> getAllRecords() throws DataStoreException
SharedDataStoregetAllRecords in interface SharedDataStoreDataStoreExceptionpublic DataRecord getRecordForId(DataIdentifier identifier) throws DataStoreException
SharedDataStoregetRecordForId in interface SharedDataStoreidentifier - the if of the recordDataStoreExceptionpublic SharedDataStore.Type getType()
SharedDataStoregetType in interface SharedDataStorepublic DataRecord addRecord(InputStream input, org.apache.jackrabbit.oak.spi.blob.BlobOptions options) throws DataStoreException
TypedDataStoreaddRecord in interface TypedDataStoreDataStoreExceptionpublic DataStore getDataStore()
public org.apache.jackrabbit.oak.cache.CacheStats getCacheStats()
public void setMaxCachedBinarySize(int maxCachedBinarySize)
public void setBlobStatsCollector(org.apache.jackrabbit.oak.spi.blob.stats.BlobStatsCollector stats)
public void addTracker(BlobTracker tracker)
BlobTrackingStoreaddTracker in interface BlobTrackingStore@Nullable public BlobTracker getTracker()
BlobTrackingStoregetTracker in interface BlobTrackingStoreprotected InputStream getStream(String blobId) throws IOException
IOExceptionprotected DataRecord getDataRecord(String blobId) throws DataStoreException
DataStoreExceptionCopyright © 2012–2017 The Apache Software Foundation. All rights reserved.