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.
|
getRecordFromReference
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMinRecordLength
public void init(java.lang.String homeDir) throws DataStoreException
DataStore
init
in interface DataStore
homeDir
- the home directory of the repositoryDataStoreException
public DataRecord getRecord(DataIdentifier identifier) throws DataStoreException
DataStore
getRecord
in interface DataStore
getRecord
in class AbstractDataStore
identifier
- 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
DataStore
getRecordIfStored
in interface DataStore
dataIdentifier
- data identifierDataStoreException
- if the data store could not be accessedpublic DataRecord addRecord(java.io.InputStream inputStream) throws DataStoreException
DataStore
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(); }
addRecord
in interface DataStore
inputStream
- binary streamDataStoreException
- if the data store could not be accessedpublic DataRecord addRecord(java.io.InputStream inputStream, BlobOptions blobOptions) throws DataStoreException
TypedDataStore
addRecord
in interface TypedDataStore
DataStoreException
public java.util.Iterator<DataIdentifier> getAllIdentifiers() throws DataStoreException
getAllIdentifiers
in interface DataStore
DataStoreException
public void deleteRecord(DataIdentifier dataIdentifier) throws DataStoreException
MultiDataStoreAware
MultiDataStore.MoveDataTask
.deleteRecord
in interface MultiDataStoreAware
dataIdentifier
- data identifierDataStoreException
- if the data store could not be accessed, or if the given
identifier is invalidpublic void close() throws DataStoreException
DataStore
close
in interface DataStore
DataStoreException
- 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 SharedDataStore
stream
- the streamname
- the name of the root recordDataStoreException
- the data store exceptionpublic void addMetadataRecord(java.io.File f, java.lang.String name) throws DataStoreException
SharedDataStore
addMetadataRecord
in interface SharedDataStore
f
- the filename
- the name of the root recordDataStoreException
- the data store exceptionpublic DataRecord getMetadataRecord(java.lang.String name)
SharedDataStore
getMetadataRecord
in interface SharedDataStore
name
- the name of the recordpublic boolean metadataRecordExists(java.lang.String name)
SharedDataStore
metadataRecordExists
in interface SharedDataStore
public java.util.List<DataRecord> getAllMetadataRecords(java.lang.String prefix)
SharedDataStore
getAllMetadataRecords
in interface SharedDataStore
public boolean deleteMetadataRecord(java.lang.String name)
SharedDataStore
deleteMetadataRecord
in interface SharedDataStore
name
- the name of the root recordpublic void deleteAllMetadataRecords(java.lang.String prefix)
SharedDataStore
deleteAllMetadataRecords
in interface SharedDataStore
prefix
- metadata type identifierpublic java.util.Iterator<DataRecord> getAllRecords() throws DataStoreException
SharedDataStore
getAllRecords
in interface SharedDataStore
DataStoreException
public DataRecord getRecordForId(DataIdentifier identifier) throws DataStoreException
SharedDataStore
getRecordForId
in interface SharedDataStore
identifier
- the if of the recordDataStoreException
public SharedDataStore.Type getType()
SharedDataStore
getType
in interface SharedDataStore
public void clearInUse()
clearInUse
in interface DataStore
public void updateModifiedDateOnAccess(long l)
DataStore
updateModifiedDateOnAccess
in interface DataStore
l
- - update the modified date to the current time if it is older than this valuepublic int deleteAllOlderThan(long l) throws DataStoreException
DataStore
deleteAllOlderThan
in interface DataStore
l
- the minimum timeDataStoreException
Copyright © 2010 - 2020 Adobe. All Rights Reserved