public abstract class AbstractSharedCachingDataStore extends AbstractDataStore implements MultiDataStoreAware, SharedDataStore, TypedDataStore
<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>
SharedDataStore.Type| Constructor and Description |
|---|
AbstractSharedCachingDataStore() |
| 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)
------------------------ SharedDataStore methods -----------------------------------------
|
DataRecord |
addRecord(java.io.InputStream inputStream)
Creates a new data record.
|
DataRecord |
addRecord(java.io.InputStream inputStream,
BlobOptions blobOptions)
Add a record with specified options.
|
void |
clearInUse()
------------------------ unimplemented methods -------------------------------------------
|
void |
close()
Close the data store
|
void |
deleteAllMetadataRecords(java.lang.String prefix)
Deletes all records matching the given prefix.
|
int |
deleteAllOlderThan(long l)
Delete objects that have a modified date older than the specified date.
|
boolean |
deleteMetadataRecord(java.lang.String name)
Deletes the root record represented by the given parameters.
|
void |
deleteRecord(DataIdentifier dataIdentifier)
Deletes a single DataRecord based on the given identifier.
|
boolean |
exists(DataIdentifier identifier)
Look in the backend for a record matching the given identifier.
|
java.util.Iterator<DataIdentifier> |
getAllIdentifiers()
In rare cases may include some duplicates in cases where async staged uploads complete
during iteration.
|
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.
|
DataRecord |
getMetadataRecord(java.lang.String name)
Retrieves the metadata record with the given name
|
DataRecord |
getRecord(DataIdentifier identifier)
Returns the identified data record.
|
DataRecord |
getRecordForId(DataIdentifier identifier)
Retrieves the record for the given identifier
|
@Nullable DataRecord |
getRecordIfStored(DataIdentifier dataIdentifier)
Check if a record for the given identifier exists, and return it if yes.
|
java.util.List<DataStoreCacheStatsMBean> |
getStats() |
SharedDataStore.Type |
getType()
Gets the type.
|
void |
init(java.lang.String homeDir)
Initialized the data store
|
boolean |
metadataRecordExists(java.lang.String name)
Checks if the metadata record with the name exists
|
void |
setCacheSize(long cacheSize) |
void |
setPath(java.lang.String path)
------------------------- setters ----------------------------------------------
|
void |
setStagingPurgeInterval(int stagingPurgeInterval) |
void |
setStagingRetryInterval(int stagingRetryInterval) |
void |
setStagingSplitPercentage(int stagingSplitPercentage) |
void |
setStatisticsProvider(StatisticsProvider statisticsProvider) |
void |
setUploadThreads(int uploadThreads) |
void |
updateModifiedDateOnAccess(long l)
From now on, update the modified date of an object even when accessing it.
|
getRecordFromReferenceequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetMinRecordLengthpublic void init(java.lang.String homeDir)
throws DataStoreException
DataStoreinit in interface DataStorehomeDir - the home directory of the repositoryDataStoreExceptionpublic DataRecord getRecord(DataIdentifier identifier) throws DataStoreException
DataStoregetRecord in interface DataStoregetRecord in class AbstractDataStoreidentifier - data identifierDataStoreException - if the data store could not be accessed,
or if the given identifier is invalid@Nullable public @Nullable DataRecord getRecordIfStored(DataIdentifier dataIdentifier) throws DataStoreException
DataStoregetRecordIfStored in interface DataStoredataIdentifier - data identifierDataStoreException - if the data store could not be accessedpublic DataRecord addRecord(java.io.InputStream inputStream) throws DataStoreException
DataStoreThe 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();
}
addRecord in interface DataStoreinputStream - binary streamDataStoreException - if the data store could not be accessedpublic DataRecord addRecord(java.io.InputStream inputStream, BlobOptions blobOptions) throws DataStoreException
TypedDataStoreaddRecord in interface TypedDataStoreDataStoreExceptionpublic java.util.Iterator<DataIdentifier> getAllIdentifiers() throws DataStoreException
getAllIdentifiers in interface DataStoreDataStoreExceptionpublic void deleteRecord(DataIdentifier dataIdentifier) throws DataStoreException
MultiDataStoreAwareMultiDataStore.MoveDataTask.deleteRecord in interface MultiDataStoreAwaredataIdentifier - data identifierDataStoreException - if the data store could not be accessed, or if the given
identifier is invalidpublic void close()
throws DataStoreException
DataStoreclose in interface DataStoreDataStoreException - if a problem occurredpublic boolean exists(DataIdentifier identifier)
identifier - - An identifier for the record.public java.util.List<DataStoreCacheStatsMBean> getStats()
public void setPath(java.lang.String path)
public void setCacheSize(long cacheSize)
public void setStagingSplitPercentage(int stagingSplitPercentage)
public void setUploadThreads(int uploadThreads)
public void setStagingPurgeInterval(int stagingPurgeInterval)
public void setStagingRetryInterval(int stagingRetryInterval)
public void setStatisticsProvider(StatisticsProvider statisticsProvider)
public void addMetadataRecord(java.io.InputStream stream,
java.lang.String name)
throws DataStoreException
addMetadataRecord 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 void clearInUse()
clearInUse in interface DataStorepublic void updateModifiedDateOnAccess(long l)
DataStoreupdateModifiedDateOnAccess in interface DataStorel - - update the modified date to the current time if it is older than this valuepublic int deleteAllOlderThan(long l)
throws DataStoreException
DataStoredeleteAllOlderThan in interface DataStorel - the minimum timeDataStoreExceptionCopyright © 2010 - 2023 Adobe. All Rights Reserved