public class DataStoreBlobStore extends java.lang.Object implements DataStore, org.apache.jackrabbit.oak.spi.blob.BlobStore, org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStore, BlobTrackingStore, TypedDataStore, org.apache.jackrabbit.oak.api.blob.BlobAccessProvider
DataStore.getMinRecordLength()| Modifier and Type | Class and Description |
|---|---|
static class |
DataStoreBlobStore.BlobId |
SharedDataStore.Type| Modifier and Type | Field and Description |
|---|---|
protected LoadingCache<java.lang.String,byte[]> |
cache |
static int |
DEFAULT_CACHE_SIZE |
protected DataStore |
delegate |
static java.lang.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) |
| Modifier and Type | Method and Description |
|---|---|
void |
addMetadataRecord(java.io.File f,
java.lang.String name)
Adds the root record.
|
void |
addMetadataRecord(java.io.InputStream stream,
java.lang.String name)
Adds the root record.
|
DataRecord |
addRecord(java.io.InputStream stream) |
DataRecord |
addRecord(java.io.InputStream input,
org.apache.jackrabbit.oak.spi.blob.BlobOptions options)
Add a record with specified options.
|
void |
addTracker(BlobTracker tracker)
Registers a tracker in the data store.
|
void |
clearCache() |
void |
clearInUse() |
void |
close() |
@Nullable org.apache.jackrabbit.oak.api.Blob |
completeBlobUpload(@NotNull java.lang.String uploadToken) |
long |
countDeleteChunks(java.util.List<java.lang.String> chunkIds,
long maxLastModifiedTime) |
void |
deleteAllMetadataRecords(java.lang.String prefix)
Deletes all records matching the given prefix.
|
int |
deleteAllOlderThan(long min) |
boolean |
deleteChunks(java.util.List<java.lang.String> chunkIds,
long maxLastModifiedTime) |
boolean |
deleteMetadataRecord(java.lang.String name)
Deletes the root record represented by the given parameters.
|
protected java.lang.String |
extractBlobId(java.lang.String encodedBlobId) |
java.util.Iterator<java.lang.String> |
getAllChunkIds(long maxLastModifiedTime) |
java.util.Iterator<DataIdentifier> |
getAllIdentifiers() |
java.util.List<DataRecord> |
getAllMetadataRecords(java.lang.String prefix)
Gets the all root records.
|
java.util.Iterator<DataRecord> |
getAllRecords()
Retrieved an iterator over all DataRecords.
|
java.lang.String |
getBlobId(@NotNull java.lang.String reference) |
long |
getBlobLength(java.lang.String encodedBlobId) |
long |
getBlockSizeMin() |
org.apache.jackrabbit.oak.cache.CacheStats |
getCacheStats() |
protected DataRecord |
getDataRecord(java.lang.String blobId) |
DataStore |
getDataStore() |
@Nullable java.net.URI |
getDownloadURI(@NotNull org.apache.jackrabbit.oak.api.Blob blob,
@NotNull org.apache.jackrabbit.oak.api.blob.BlobDownloadOptions downloadOptions) |
java.io.InputStream |
getInputStream(java.lang.String encodedBlobId) |
DataRecord |
getMetadataRecord(java.lang.String name)
Retrieves the metadata record with the given name
|
int |
getMinRecordLength() |
DataRecord |
getRecord(DataIdentifier identifier) |
DataRecord |
getRecordForId(DataIdentifier identifier)
Retrieves the record for the given identifier
|
DataRecord |
getRecordFromReference(java.lang.String reference) |
DataRecord |
getRecordIfStored(DataIdentifier identifier) |
java.lang.String |
getReference(@NotNull java.lang.String encodedBlobId) |
protected java.io.InputStream |
getStream(java.lang.String blobId) |
@Nullable BlobTracker |
getTracker()
Gets the traker registered in the data store.
|
SharedDataStore.Type |
getType()
Gets the type.
|
void |
init(java.lang.String homeDir) |
@Nullable org.apache.jackrabbit.oak.api.blob.BlobUpload |
initiateBlobUpload(long maxUploadSizeInBytes,
int maxNumberOfURIs) |
@Nullable org.apache.jackrabbit.oak.api.blob.BlobUpload |
initiateBlobUpload(long maxUploadSizeInBytes,
int maxNumberOfURIs,
@NotNull org.apache.jackrabbit.oak.api.blob.BlobUploadOptions options) |
boolean |
metadataRecordExists(java.lang.String name)
Checks if the metadata record with the name exists
|
int |
readBlob(java.lang.String encodedBlobId,
long pos,
byte[] buff,
int off,
int length) |
java.util.Iterator<java.lang.String> |
resolveChunks(java.lang.String blobId) |
void |
setBlobStatsCollector(org.apache.jackrabbit.oak.spi.blob.stats.BlobStatsCollector stats) |
void |
setBlockSize(int x) |
void |
setMaxCachedBinarySize(int maxCachedBinarySize) |
void |
startMark() |
int |
sweep() |
java.lang.String |
toString() |
void |
updateModifiedDateOnAccess(long before) |
java.lang.String |
writeBlob(java.io.InputStream stream) |
java.lang.String |
writeBlob(java.io.InputStream stream,
org.apache.jackrabbit.oak.spi.blob.BlobOptions options) |
java.lang.String |
writeBlob(java.lang.String tempFileName) |
protected final DataStore delegate
protected org.apache.jackrabbit.oak.spi.blob.stats.BlobStatsCollector stats
protected final LoadingCache<java.lang.String,byte[]> cache
public static final int DEFAULT_CACHE_SIZE
public static final java.lang.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(java.lang.String reference) throws DataStoreException
getRecordFromReference in interface DataStoreDataStoreExceptionpublic DataRecord addRecord(java.io.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 java.util.Iterator<DataIdentifier> getAllIdentifiers() throws DataStoreException
getAllIdentifiers in interface DataStoreDataStoreExceptionpublic void init(java.lang.String homeDir)
throws RepositoryException
init in interface DataStoreRepositoryExceptionpublic int getMinRecordLength()
getMinRecordLength in interface DataStorepublic void close()
throws DataStoreException
close in interface java.lang.AutoCloseableclose in interface DataStoreDataStoreExceptionpublic java.lang.String writeBlob(java.io.InputStream stream)
throws java.io.IOException
writeBlob in interface org.apache.jackrabbit.oak.spi.blob.BlobStorejava.io.IOExceptionpublic java.lang.String writeBlob(java.io.InputStream stream,
org.apache.jackrabbit.oak.spi.blob.BlobOptions options)
throws java.io.IOException
writeBlob in interface org.apache.jackrabbit.oak.spi.blob.BlobStorejava.io.IOExceptionpublic int readBlob(java.lang.String encodedBlobId,
long pos,
byte[] buff,
int off,
int length)
throws java.io.IOException
readBlob in interface org.apache.jackrabbit.oak.spi.blob.BlobStorejava.io.IOExceptionpublic long getBlobLength(java.lang.String encodedBlobId)
throws java.io.IOException
getBlobLength in interface org.apache.jackrabbit.oak.spi.blob.BlobStorejava.io.IOExceptionpublic java.lang.String getBlobId(@NotNull
@NotNull java.lang.String reference)
getBlobId in interface org.apache.jackrabbit.oak.spi.blob.BlobStorepublic java.lang.String getReference(@NotNull
@NotNull java.lang.String encodedBlobId)
getReference in interface org.apache.jackrabbit.oak.spi.blob.BlobStorepublic java.io.InputStream getInputStream(java.lang.String encodedBlobId)
throws java.io.IOException
getInputStream in interface org.apache.jackrabbit.oak.spi.blob.BlobStorejava.io.IOExceptionpublic void setBlockSize(int x)
setBlockSize in interface org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStorepublic java.lang.String writeBlob(java.lang.String tempFileName)
throws java.io.IOException
writeBlob in interface org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStorejava.io.IOExceptionpublic int sweep()
throws java.io.IOException
sweep in interface org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStorejava.io.IOExceptionpublic void startMark()
throws java.io.IOException
startMark in interface org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStorejava.io.IOExceptionpublic 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 java.util.Iterator<java.lang.String> getAllChunkIds(long maxLastModifiedTime)
throws java.lang.Exception
getAllChunkIds in interface org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStorejava.lang.Exceptionpublic boolean deleteChunks(java.util.List<java.lang.String> chunkIds,
long maxLastModifiedTime)
throws java.lang.Exception
deleteChunks in interface org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStorejava.lang.Exceptionpublic long countDeleteChunks(java.util.List<java.lang.String> chunkIds,
long maxLastModifiedTime)
throws java.lang.Exception
countDeleteChunks in interface org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStorejava.lang.Exceptionpublic java.util.Iterator<java.lang.String> resolveChunks(java.lang.String blobId)
throws java.io.IOException
resolveChunks in interface org.apache.jackrabbit.oak.spi.blob.GarbageCollectableBlobStorejava.io.IOExceptionpublic void addMetadataRecord(java.io.InputStream stream,
java.lang.String name)
throws DataStoreException
SharedDataStoreaddMetadataRecord in interface SharedDataStorestream - the streamname - the name of the root recordDataStoreException - the data store exceptionpublic void addMetadataRecord(java.io.File f,
java.lang.String name)
throws DataStoreException
SharedDataStoreaddMetadataRecord in interface SharedDataStoref - the filename - the name of the root recordDataStoreException - the data store exceptionpublic DataRecord getMetadataRecord(java.lang.String name)
SharedDataStoregetMetadataRecord in interface SharedDataStorename - the name of the recordpublic boolean metadataRecordExists(java.lang.String name)
SharedDataStoremetadataRecordExists in interface SharedDataStorepublic java.util.List<DataRecord> getAllMetadataRecords(java.lang.String prefix)
SharedDataStoregetAllMetadataRecords in interface SharedDataStorepublic boolean deleteMetadataRecord(java.lang.String name)
SharedDataStoredeleteMetadataRecord in interface SharedDataStorename - the name of the root recordpublic void deleteAllMetadataRecords(java.lang.String prefix)
SharedDataStoredeleteAllMetadataRecords in interface SharedDataStoreprefix - metadata type identifierpublic java.util.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(java.io.InputStream input, org.apache.jackrabbit.oak.spi.blob.BlobOptions options) throws DataStoreException
TypedDataStoreaddRecord in interface TypedDataStoreDataStoreExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic 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 @Nullable BlobTracker getTracker()
BlobTrackingStoregetTracker in interface BlobTrackingStoreprotected java.io.InputStream getStream(java.lang.String blobId)
throws java.io.IOException
java.io.IOExceptionprotected DataRecord getDataRecord(java.lang.String blobId) throws DataStoreException
DataStoreExceptionprotected java.lang.String extractBlobId(java.lang.String encodedBlobId)
@Nullable public @Nullable org.apache.jackrabbit.oak.api.blob.BlobUpload initiateBlobUpload(long maxUploadSizeInBytes, int maxNumberOfURIs) throws java.lang.IllegalArgumentException
initiateBlobUpload in interface org.apache.jackrabbit.oak.api.blob.BlobAccessProviderjava.lang.IllegalArgumentException@Nullable public @Nullable org.apache.jackrabbit.oak.api.blob.BlobUpload initiateBlobUpload(long maxUploadSizeInBytes, int maxNumberOfURIs, @NotNull @NotNull org.apache.jackrabbit.oak.api.blob.BlobUploadOptions options) throws java.lang.IllegalArgumentException
initiateBlobUpload in interface org.apache.jackrabbit.oak.api.blob.BlobAccessProviderjava.lang.IllegalArgumentException@Nullable public @Nullable org.apache.jackrabbit.oak.api.Blob completeBlobUpload(@NotNull @NotNull java.lang.String uploadToken) throws java.lang.IllegalArgumentException
completeBlobUpload in interface org.apache.jackrabbit.oak.api.blob.BlobAccessProviderjava.lang.IllegalArgumentException@Nullable
public @Nullable java.net.URI getDownloadURI(@NotNull
@NotNull org.apache.jackrabbit.oak.api.Blob blob,
@NotNull
@NotNull org.apache.jackrabbit.oak.api.blob.BlobDownloadOptions downloadOptions)
getDownloadURI in interface org.apache.jackrabbit.oak.api.blob.BlobAccessProviderCopyright © 2012–2022 The Apache Software Foundation. All rights reserved.