public class LengthCachingDataStore extends AbstractDataStore
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>
Modifier and Type | Field and Description |
---|---|
static char |
SEPARATOR
Separator used while writing length and identifier to the mapping file
|
Constructor and Description |
---|
LengthCachingDataStore() |
Modifier and Type | Method and Description |
---|---|
DataRecord |
addRecord(InputStream inputStream) |
void |
clearInUse() |
void |
close() |
int |
deleteAllOlderThan(long min) |
Iterator<DataIdentifier> |
getAllIdentifiers() |
int |
getMinRecordLength() |
DataRecord |
getRecordFromReference(String reference) |
DataRecord |
getRecordIfStored(DataIdentifier dataIdentifier) |
void |
init(String homeDir) |
void |
setDelegateClass(String delegateClass) |
void |
setDelegateConfigFilePath(String delegateConfigFilePath) |
void |
setMappingFilePath(String mappingFilePath) |
void |
setReadOnly(boolean readOnly) |
void |
updateModifiedDateOnAccess(long before) |
encodeHexString, getOrCreateReferenceKey, getRecord, getReferenceFromIdentifier
public static final char SEPARATOR
public void init(String homeDir) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public DataRecord getRecordIfStored(DataIdentifier dataIdentifier) throws DataStoreException
DataStoreException
public DataRecord getRecordFromReference(String reference) throws DataStoreException
getRecordFromReference
in interface DataStore
getRecordFromReference
in class AbstractDataStore
DataStoreException
public DataRecord addRecord(InputStream inputStream) throws DataStoreException
DataStoreException
public void updateModifiedDateOnAccess(long before)
public int deleteAllOlderThan(long min) throws DataStoreException
DataStoreException
public Iterator<DataIdentifier> getAllIdentifiers() throws DataStoreException
DataStoreException
public int getMinRecordLength()
public void close() throws DataStoreException
DataStoreException
public void clearInUse()
public void setMappingFilePath(String mappingFilePath)
public void setReadOnly(boolean readOnly)
public void setDelegateClass(String delegateClass)
public void setDelegateConfigFilePath(String delegateConfigFilePath)
Copyright © 2012-2018 The Apache Software Foundation. All Rights Reserved.