Class AbstractSharedCachingDataStore
java.lang.Object
org.apache.jackrabbit.core.data.AbstractDataStore
org.apache.jackrabbit.oak.plugins.blob.AbstractSharedCachingDataStore
- All Implemented Interfaces:
DataStore
,MultiDataStoreAware
,TypedDataStore
,SharedDataStore
- Direct Known Subclasses:
CachingFileDataStore
@Deprecated(since="2024-09-23")
public abstract class AbstractSharedCachingDataStore
extends AbstractDataStore
implements MultiDataStoreAware, SharedDataStore, TypedDataStore
Deprecated.
The Jackrabbit Oak Blob Plugins library is designed for Oak-internal use only and thus deprecated. It will not be part of the AEM SDK after April 2025.
Cache files locally and stage files locally for async uploads.
Configuration:
<DataStore class="org.apache.jackrabbit.oak.plugins.blob.AbstractCachingDataStore"> <param name="path
"/> <param name="cacheSize
" value="68719476736"/> <param name="stagingSplitPercentage
" value="10"/> <param name="uploadThreads
" value="10"/> <param name="stagingPurgeInterval
" value="300"/> <param name="stagingRetryInterval
" value="600"/> </DataStore>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.jackrabbit.oak.plugins.blob.SharedDataStore
SharedDataStore.Type
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMetadataRecord
(File f, String name) Deprecated.Adds the root record.void
addMetadataRecord
(InputStream stream, String name) Deprecated.------------------------ SharedDataStore methods -----------------------------------------*addRecord
(InputStream inputStream) Deprecated.Creates a new data record.addRecord
(InputStream inputStream, BlobOptions blobOptions) Deprecated.Add a record with specified options.void
Deprecated.------------------------ unimplemented methods -------------------------------------------*void
close()
Deprecated.Close the data storevoid
deleteAllMetadataRecords
(String prefix) Deprecated.Deletes all records matching the given prefix.int
deleteAllOlderThan
(long l) Deprecated.Delete objects that have a modified date older than the specified date.boolean
deleteMetadataRecord
(String name) Deprecated.Deletes the root record represented by the given parameters.void
deleteRecord
(DataIdentifier dataIdentifier) Deprecated.Deletes a single DataRecord based on the given identifier.boolean
exists
(DataIdentifier identifier) Deprecated.Look in the backend for a record matching the given identifier.Deprecated.In rare cases may include some duplicates in cases where async staged uploads complete during iteration.getAllMetadataRecords
(String prefix) Deprecated.Gets the all root records.Deprecated.Retrieved an iterator over all DataRecords.getMetadataRecord
(String name) Deprecated.Retrieves the metadata record with the given namegetRecord
(DataIdentifier identifier) Deprecated.Returns the identified data record.getRecordForId
(DataIdentifier identifier) Deprecated.Retrieves the record for the given identifier@Nullable DataRecord
getRecordIfStored
(DataIdentifier dataIdentifier) Deprecated.Check if a record for the given identifier exists, and return it if yes.getStats()
Deprecated.getType()
Deprecated.Gets the type.void
Deprecated.Initialized the data storeboolean
metadataRecordExists
(String name) Deprecated.Checks if the metadata record with the name existsvoid
setCacheSize
(long cacheSize) Deprecated.void
Deprecated.------------------------- setters ----------------------------------------------*void
setStagingPurgeInterval
(int stagingPurgeInterval) Deprecated.void
setStagingRetryInterval
(int stagingRetryInterval) Deprecated.void
setStagingSplitPercentage
(int stagingSplitPercentage) Deprecated.void
setStatisticsProvider
(StatisticsProvider statisticsProvider) Deprecated.void
setUploadThreads
(int uploadThreads) Deprecated.void
updateModifiedDateOnAccess
(long l) Deprecated.From now on, update the modified date of an object even when accessing it.Methods inherited from class org.apache.jackrabbit.core.data.AbstractDataStore
getRecordFromReference
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.jackrabbit.core.data.DataStore
getMinRecordLength
Methods inherited from interface org.apache.jackrabbit.oak.plugins.blob.SharedDataStore
getRepositoryId, setRepositoryId
-
Constructor Details
-
AbstractSharedCachingDataStore
public AbstractSharedCachingDataStore()Deprecated.
-
-
Method Details
-
init
Deprecated.Description copied from interface:DataStore
Initialized the data store- Specified by:
init
in interfaceDataStore
- Parameters:
homeDir
- the home directory of the repository- Throws:
DataStoreException
-
getRecord
Deprecated.Description copied from interface:DataStore
Returns the identified data record. The given identifier should be the identifier of a previously saved data record. Since records are never removed, there should never be cases where the identified record is not found. Abnormal cases like that are treated as errors and handled by throwing an exception.- Specified by:
getRecord
in interfaceDataStore
- Overrides:
getRecord
in classAbstractDataStore
- Parameters:
identifier
- data identifier- Returns:
- identified data record
- Throws:
DataStoreException
- if the data store could not be accessed, or if the given identifier is invalid
-
getRecordIfStored
@Nullable public @Nullable DataRecord getRecordIfStored(DataIdentifier dataIdentifier) throws DataStoreException Deprecated.Description copied from interface:DataStore
Check if a record for the given identifier exists, and return it if yes. If no record exists, this method returns null.- Specified by:
getRecordIfStored
in interfaceDataStore
- Parameters:
dataIdentifier
- data identifier- Returns:
- the record if found, and null if not
- Throws:
DataStoreException
- if the data store could not be accessed
-
addRecord
Deprecated.Description copied from interface:DataStore
Creates a new data record. The given binary stream is consumed and a binary record containing the consumed stream is created and returned. If the same stream already exists in another record, then that record is returned instead of creating a new one.The given stream is consumed and not closed by this method. It is the responsibility of the caller to close the stream. A typical call pattern would be:
InputStream stream = ...; try { record = store.addRecord(stream); } finally { stream.close(); }
- Specified by:
addRecord
in interfaceDataStore
- Parameters:
inputStream
- binary stream- Returns:
- data record that contains the given stream
- Throws:
DataStoreException
- if the data store could not be accessed
-
addRecord
public DataRecord addRecord(InputStream inputStream, BlobOptions blobOptions) throws DataStoreException Deprecated.Description copied from interface:TypedDataStore
Add a record with specified options.- Specified by:
addRecord
in interfaceTypedDataStore
- Parameters:
inputStream
-blobOptions
-- Returns:
- Throws:
DataStoreException
-
getAllIdentifiers
Deprecated.In rare cases may include some duplicates in cases where async staged uploads complete during iteration.- Specified by:
getAllIdentifiers
in interfaceDataStore
- Returns:
- Iterator over all ids available
- Throws:
DataStoreException
-
deleteRecord
Deprecated.Description copied from interface:MultiDataStoreAware
Deletes a single DataRecord based on the given identifier. Delete will only be used by theMultiDataStore.MoveDataTask
.- Specified by:
deleteRecord
in interfaceMultiDataStoreAware
- Parameters:
dataIdentifier
- data identifier- Throws:
DataStoreException
- if the data store could not be accessed, or if the given identifier is invalid
-
close
Deprecated.Description copied from interface:DataStore
Close the data store- Specified by:
close
in interfaceDataStore
- Throws:
DataStoreException
- if a problem occurred
-
exists
Deprecated.Look in the backend for a record matching the given identifier. Returns true if such a record exists.- Parameters:
identifier
- - An identifier for the record.- Returns:
- true if a record for the provided identifier can be found.
-
getStats
Deprecated. -
setPath
Deprecated.------------------------- setters ----------------------------------------------* -
setCacheSize
public void setCacheSize(long cacheSize) Deprecated. -
setStagingSplitPercentage
public void setStagingSplitPercentage(int stagingSplitPercentage) Deprecated. -
setUploadThreads
public void setUploadThreads(int uploadThreads) Deprecated. -
setStagingPurgeInterval
public void setStagingPurgeInterval(int stagingPurgeInterval) Deprecated. -
setStagingRetryInterval
public void setStagingRetryInterval(int stagingRetryInterval) Deprecated. -
setStatisticsProvider
Deprecated. -
addMetadataRecord
Deprecated.------------------------ SharedDataStore methods -----------------------------------------*- Specified by:
addMetadataRecord
in interfaceSharedDataStore
- Parameters:
stream
- the streamname
- the name of the root record- Throws:
DataStoreException
- the data store exception
-
addMetadataRecord
Deprecated.Description copied from interface:SharedDataStore
Adds the root record.- Specified by:
addMetadataRecord
in interfaceSharedDataStore
- Parameters:
f
- the filename
- the name of the root record- Throws:
DataStoreException
- the data store exception
-
getMetadataRecord
Deprecated.Description copied from interface:SharedDataStore
Retrieves the metadata record with the given name- Specified by:
getMetadataRecord
in interfaceSharedDataStore
- Parameters:
name
- the name of the record- Returns:
-
metadataRecordExists
Deprecated.Description copied from interface:SharedDataStore
Checks if the metadata record with the name exists- Specified by:
metadataRecordExists
in interfaceSharedDataStore
- Parameters:
name
-- Returns:
-
getAllMetadataRecords
Deprecated.Description copied from interface:SharedDataStore
Gets the all root records.- Specified by:
getAllMetadataRecords
in interfaceSharedDataStore
- Returns:
- the all root records
-
deleteMetadataRecord
Deprecated.Description copied from interface:SharedDataStore
Deletes the root record represented by the given parameters.- Specified by:
deleteMetadataRecord
in interfaceSharedDataStore
- Parameters:
name
- the name of the root record- Returns:
- success/failure
-
deleteAllMetadataRecords
Deprecated.Description copied from interface:SharedDataStore
Deletes all records matching the given prefix.- Specified by:
deleteAllMetadataRecords
in interfaceSharedDataStore
- Parameters:
prefix
- metadata type identifier
-
getAllRecords
Deprecated.Description copied from interface:SharedDataStore
Retrieved an iterator over all DataRecords.- Specified by:
getAllRecords
in interfaceSharedDataStore
- Returns:
- iterator over DataRecords
- Throws:
DataStoreException
-
getRecordForId
Deprecated.Description copied from interface:SharedDataStore
Retrieves the record for the given identifier- Specified by:
getRecordForId
in interfaceSharedDataStore
- Parameters:
identifier
- the if of the record- Returns:
- data record
- Throws:
DataStoreException
-
getType
Deprecated.Description copied from interface:SharedDataStore
Gets the type.- Specified by:
getType
in interfaceSharedDataStore
- Returns:
- the type
-
clearInUse
public void clearInUse()Deprecated.------------------------ unimplemented methods -------------------------------------------*- Specified by:
clearInUse
in interfaceDataStore
-
updateModifiedDateOnAccess
public void updateModifiedDateOnAccess(long l) Deprecated.Description copied from interface:DataStore
From now on, update the modified date of an object even when accessing it. Usually, the modified date is only updated when creating a new object, or when a new link is added to an existing object. When this setting is enabled, even getLength() will update the modified date.- Specified by:
updateModifiedDateOnAccess
in interfaceDataStore
- Parameters:
l
- - update the modified date to the current time if it is older than this value
-
deleteAllOlderThan
Deprecated.Description copied from interface:DataStore
Delete objects that have a modified date older than the specified date.- Specified by:
deleteAllOlderThan
in interfaceDataStore
- Parameters:
l
- the minimum time- Returns:
- the number of data records deleted
- Throws:
DataStoreException
-