Class LengthCachingDataStore
- java.lang.Object
-
- org.apache.jackrabbit.core.data.AbstractDataStore
-
- org.apache.jackrabbit.oak.upgrade.blob.LengthCachingDataStore
-
- All Implemented Interfaces:
DataStore
public class LengthCachingDataStore extends AbstractDataStore
A DelegatingDataStore can avoid performing expensive file system access by making use of pre computed data related to files in DataStore.During repository migration actual blob content is not accessed and instead only the blob length and blob references are accessed. DelegatingDataStore can be configured with a mapping file which would be used to determine the length of given blob reference.
Mapping file format
#< length >| < identifier > 4432|dd10bca036f3134352c63e534d4568a3d2ac2fdc 32167|dd10bca036f3134567c63e534d4568a3d2ac2fdc
The Configuration:
<DataStore class="org.apache.jackrabbit.oak.upgrade.blob.LengthCachingDataStore"> <param name="mappingFilePath" value="/path/to/mapping/file" /> <param name="delegateClass" value="org.apache.jackrabbit.core.data.FileDataStore" /> </DataStore>
-
-
Field Summary
Fields Modifier and Type Field Description static char
SEPARATOR
Separator used while writing length and identifier to the mapping file-
Fields inherited from class org.apache.jackrabbit.core.data.AbstractDataStore
DIGEST
-
-
Constructor Summary
Constructors Constructor Description LengthCachingDataStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataRecord
addRecord(java.io.InputStream inputStream)
void
clearInUse()
void
close()
int
deleteAllOlderThan(long min)
java.util.Iterator<DataIdentifier>
getAllIdentifiers()
int
getMinRecordLength()
DataRecord
getRecordFromReference(java.lang.String reference)
DataRecord
getRecordIfStored(DataIdentifier dataIdentifier)
void
init(java.lang.String homeDir)
void
setDelegateClass(java.lang.String delegateClass)
void
setDelegateConfigFilePath(java.lang.String delegateConfigFilePath)
void
setMappingFilePath(java.lang.String mappingFilePath)
void
setReadOnly(boolean readOnly)
void
updateModifiedDateOnAccess(long before)
-
Methods inherited from class org.apache.jackrabbit.core.data.AbstractDataStore
encodeHexString, getOrCreateReferenceKey, getRecord, getReferenceFromIdentifier
-
-
-
-
Field Detail
-
SEPARATOR
public static final char SEPARATOR
Separator used while writing length and identifier to the mapping file- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init(java.lang.String homeDir) throws javax.jcr.RepositoryException
- Throws:
javax.jcr.RepositoryException
-
getRecordIfStored
public DataRecord getRecordIfStored(DataIdentifier dataIdentifier) throws DataStoreException
- Throws:
DataStoreException
-
getRecordFromReference
public DataRecord getRecordFromReference(java.lang.String reference) throws DataStoreException
- Specified by:
getRecordFromReference
in interfaceDataStore
- Overrides:
getRecordFromReference
in classAbstractDataStore
- Throws:
DataStoreException
-
addRecord
public DataRecord addRecord(java.io.InputStream inputStream) throws DataStoreException
- Throws:
DataStoreException
-
updateModifiedDateOnAccess
public void updateModifiedDateOnAccess(long before)
-
deleteAllOlderThan
public int deleteAllOlderThan(long min) throws DataStoreException
- Throws:
DataStoreException
-
getAllIdentifiers
public java.util.Iterator<DataIdentifier> getAllIdentifiers() throws DataStoreException
- Throws:
DataStoreException
-
getMinRecordLength
public int getMinRecordLength()
-
close
public void close() throws DataStoreException
- Throws:
DataStoreException
-
clearInUse
public void clearInUse()
-
setMappingFilePath
public void setMappingFilePath(java.lang.String mappingFilePath)
-
setReadOnly
public void setReadOnly(boolean readOnly)
-
setDelegateClass
public void setDelegateClass(java.lang.String delegateClass)
-
setDelegateConfigFilePath
public void setDelegateConfigFilePath(java.lang.String delegateConfigFilePath)
-
-