@Deprecated public class InMemPersistenceManager extends AbstractPersistenceManager
InMemPersistenceManager
is a very simple HashMap
-based
PersistenceManager
for Jackrabbit that keeps all data in memory
and that is capable of storing and loading its contents using a simple custom
binary serialization format (see Serializer
).
It is configured through the following properties:
initialCapacity
: initial capacity of the hash map used to store the dataloadFactor
: load factor of the hash map used to store the datapersistent
: if true
the contents of the hash map
is loaded on startup and stored on shutdown;
if false
nothing is persistedModifier and Type | Field and Description |
---|---|
protected FileSystem |
blobFS
Deprecated.
|
protected BLOBStore |
blobStore
Deprecated.
|
protected static int |
INITIAL_BUFFER_SIZE
Deprecated.
|
protected int |
initialCapacity
Deprecated.
|
protected boolean |
initialized
Deprecated.
|
protected float |
loadFactor
Deprecated.
|
protected static byte |
NODE_ENTRY
Deprecated.
|
protected boolean |
persistent
Deprecated.
|
protected static byte |
PROP_ENTRY
Deprecated.
|
protected static String |
REFS_FILE_PATH
Deprecated.
|
protected Map<NodeId,byte[]> |
refsStore
Deprecated.
|
protected static String |
STATE_FILE_PATH
Deprecated.
|
protected Map<ItemId,byte[]> |
stateStore
Deprecated.
|
protected FileSystem |
wspFS
Deprecated.
file system where the content of the hash maps are read from/written to
(if
persistent==true ) |
Constructor and Description |
---|
InMemPersistenceManager()
Deprecated.
Creates a new
InMemPersistenceManager instance. |
Modifier and Type | Method and Description |
---|---|
protected static String |
buildBlobFilePath(String parentUUID,
Name propName,
int index)
Deprecated.
|
void |
close()
Deprecated.
Closes the persistence manager.
|
protected void |
destroy(NodeReferences refs)
Deprecated.
Destroy a node references object.
|
protected void |
destroy(NodeState state)
Deprecated.
Destroy a node state.
|
protected void |
destroy(PropertyState state)
Deprecated.
Destroy a property state.
|
boolean |
exists(NodeId id)
Deprecated.
Checks whether the identified node exists.
|
boolean |
exists(PropertyId id)
Deprecated.
Checks whether the identified property exists.
|
boolean |
existsReferencesTo(NodeId id)
Deprecated.
Checks whether references of the identified target node exist.
|
String |
getInitialCapacity()
Deprecated.
|
String |
getLoadFactor()
Deprecated.
|
void |
init(PMContext context)
Deprecated.
Initializes the persistence manager.
|
boolean |
isPersistent()
Deprecated.
|
NodeState |
load(NodeId id)
Deprecated.
Load the persistent members of a node state.
|
PropertyState |
load(PropertyId id)
Deprecated.
Load the persistent members of a property state.
|
void |
loadContents()
Deprecated.
Reads the content of the hash maps from the file system
|
NodeReferences |
loadReferencesTo(NodeId id)
Deprecated.
Load the persisted references to the node with the given identifier.
|
void |
setInitialCapacity(int initialCapacity)
Deprecated.
|
void |
setInitialCapacity(String initialCapacity)
Deprecated.
|
void |
setLoadFactor(float loadFactor)
Deprecated.
|
void |
setLoadFactor(String loadFactor)
Deprecated.
|
void |
setPersistent(boolean persistent)
Deprecated.
|
void |
setPersistent(String persistent)
Deprecated.
|
protected void |
store(NodeReferences refs)
Deprecated.
Store a references object.
|
protected void |
store(NodeState state)
Deprecated.
Store a node state.
|
protected void |
store(PropertyState state)
Deprecated.
Store a property state.
|
void |
storeContents()
Deprecated.
Writes the content of the hash maps to the file system
|
checkConsistency, createNew, createNew, store
protected boolean initialized
protected static final int INITIAL_BUFFER_SIZE
protected static final String STATE_FILE_PATH
protected static final String REFS_FILE_PATH
protected static final byte NODE_ENTRY
protected static final byte PROP_ENTRY
protected FileSystem blobFS
protected BLOBStore blobStore
protected FileSystem wspFS
persistent==true
)protected int initialCapacity
protected float loadFactor
protected boolean persistent
public InMemPersistenceManager()
InMemPersistenceManager
instance.public void setInitialCapacity(int initialCapacity)
public void setInitialCapacity(String initialCapacity)
public String getInitialCapacity()
public void setLoadFactor(float loadFactor)
public void setLoadFactor(String loadFactor)
public String getLoadFactor()
public boolean isPersistent()
public void setPersistent(boolean persistent)
public void setPersistent(String persistent)
protected static String buildBlobFilePath(String parentUUID, Name propName, int index)
public void loadContents() throws Exception
Exception
- if an error occurspublic void storeContents() throws Exception
Exception
- if an error occurspublic void init(PMContext context) throws Exception
An appropriate exception is thrown if the persistence manager initialization fails for whatever reason. In this case the state of the persistence manager is undefined and the instance should be discarded.
context
- persistence manager contextException
- if the persistence manager initialization failedpublic void close() throws Exception
An appropriate exception is thrown if the persistence manager could not be closed properly. In this case the state of the persistence manager is undefined and the instance should be discarded.
Exception
- if the persistence manager failed to close properlypublic NodeState load(NodeId id) throws NoSuchItemStateException, ItemStateException
id
- node idNoSuchItemStateException
- if the node state does not existItemStateException
- if another error occurspublic PropertyState load(PropertyId id) throws NoSuchItemStateException, ItemStateException
id
- property idNoSuchItemStateException
- if the property state does not existItemStateException
- if another error occursprotected void store(NodeState state) throws ItemStateException
store
in class AbstractPersistenceManager
state
- node state to storeItemStateException
- if an error occursprotected void store(PropertyState state) throws ItemStateException
store
in class AbstractPersistenceManager
state
- property state to storeItemStateException
- if an error occursprotected void destroy(NodeState state) throws ItemStateException
destroy
in class AbstractPersistenceManager
state
- node state to destroyItemStateException
- if an error occursprotected void destroy(PropertyState state) throws ItemStateException
destroy
in class AbstractPersistenceManager
state
- property state to destroyItemStateException
- if an error occurspublic NodeReferences loadReferencesTo(NodeId id) throws NoSuchItemStateException, ItemStateException
id
- reference target node idNoSuchItemStateException
- if the target node does not existItemStateException
- if another error occursprotected void store(NodeReferences refs) throws ItemStateException
store
in class AbstractPersistenceManager
refs
- references object to storeItemStateException
- if an error occursprotected void destroy(NodeReferences refs) throws ItemStateException
destroy
in class AbstractPersistenceManager
refs
- node references object to destroyItemStateException
- if an error occurspublic boolean exists(PropertyId id) throws ItemStateException
id
- property idtrue
if the property exists,
false
otherwiseItemStateException
- on persistence manager errorspublic boolean exists(NodeId id) throws ItemStateException
id
- node idtrue
if the node exists,
false
otherwiseItemStateException
- on persistence manager errorspublic boolean existsReferencesTo(NodeId id) throws ItemStateException
id
- target node idtrue
if the references exist,
false
otherwiseItemStateException
- on persistence manager errorsCopyright © 2004–2021 The Apache Software Foundation. All rights reserved.