public class WorkspaceCache extends Object implements DocumentCache
NodeCache
implementation that uses a concurrent LRU map to store nodes. The nodes in this cache represent the actual,
unmodified values.Modifier and Type | Class and Description |
---|---|
protected class |
WorkspaceCache.NonSystemChangeNotifier |
protected class |
WorkspaceCache.SystemChangeNotifier |
Modifier | Constructor and Description |
---|---|
|
WorkspaceCache(ExecutionContext context,
String repositoryKey,
String workspaceName,
WorkspaceCache systemWorkspace,
DocumentStore documentStore,
DocumentTranslator translator,
NodeKey rootKey,
ConcurrentMap<NodeKey,CachedNode> cache,
ChangeBus changeBus,
RepositoryEnvironment repositoryEnvironment) |
protected |
WorkspaceCache(WorkspaceCache original,
ConcurrentMap<NodeKey,CachedNode> cache) |
Modifier and Type | Method and Description |
---|---|
void |
changed(ChangeSet changes)
Signal that changes have been made to the persisted data.
|
protected void |
checkNotClosed() |
void |
clear()
Clears all changes in the cache.
|
protected void |
evictChangedNodes(ChangeSet changes) |
Iterator<NodeKey> |
getAllNodeKeys()
Get an iterator over all node keys within this cache.
|
Iterator<NodeKey> |
getAllNodeKeysAtAndBelow(NodeKey startingKey)
Get an iterator over all keys for the supplied node and all its descendants.
|
ChildReference |
getChildReference(NodeKey parentKey,
NodeKey childKey) |
CachedNode |
getNode(ChildReference reference)
Get the cached representation of the node as represented by the supplied child reference.
|
CachedNode |
getNode(NodeKey key)
Get the cached representation of the node with the supplied node key.
|
String |
getRepositoryKey() |
NodeKey |
getRootKey()
Get the node key for the root node.
|
String |
getWorkspaceKey() |
String |
getWorkspaceName() |
boolean |
isEmpty()
Checks if this ws cache is empty.
|
protected void |
loadFromDocumentStore(Set<String> keys) |
void |
setMinimumStringLengthForBinaryStorage(long largeValueSize) |
void |
signalClosed()
Signal that this workspace cache has been fully closed.
|
void |
signalClosing()
Signal that this workspace cache is to be closed, and it can start reclaiming resources.
|
void |
signalDeleted()
Signal that the workspace for this workspace cache has been deleted/destroyed, so this cache is not needed anymore.
|
String |
toString() |
NodeCache |
unwrap()
Unwrap this instance.
|
WorkspaceCache |
workspaceCache() |
protected static final Logger LOGGER
public WorkspaceCache(ExecutionContext context, String repositoryKey, String workspaceName, WorkspaceCache systemWorkspace, DocumentStore documentStore, DocumentTranslator translator, NodeKey rootKey, ConcurrentMap<NodeKey,CachedNode> cache, ChangeBus changeBus, RepositoryEnvironment repositoryEnvironment)
protected WorkspaceCache(WorkspaceCache original, ConcurrentMap<NodeKey,CachedNode> cache)
public void setMinimumStringLengthForBinaryStorage(long largeValueSize)
public final WorkspaceCache workspaceCache()
workspaceCache
in interface DocumentCache
public final String getRepositoryKey()
public final String getWorkspaceKey()
public final String getWorkspaceName()
public NodeKey getRootKey()
NodeCache
getRootKey
in interface NodeCache
public CachedNode getNode(NodeKey key)
CachedNodeSupplier
getNode
in interface CachedNodeSupplier
key
- the node key; may not be nullpublic CachedNode getNode(ChildReference reference)
NodeCache
getNode(reference.getKey());
public ChildReference getChildReference(NodeKey parentKey, NodeKey childKey)
public Iterator<NodeKey> getAllNodeKeys()
NodeCache
getAllNodeKeys
in interface NodeCache
public Iterator<NodeKey> getAllNodeKeysAtAndBelow(NodeKey startingKey)
NodeCache
getAllNodeKeysAtAndBelow
in interface NodeCache
startingKey
- the key for the node to start; may not be nullpublic void clear()
NodeCache
protected void evictChangedNodes(ChangeSet changes)
public void changed(ChangeSet changes)
changes
- the changes to be made; may not be nullprotected final void checkNotClosed()
public void signalDeleted()
public void signalClosing()
public void signalClosed()
public boolean isEmpty()
true
if the system key is the only key under root, false
other wise.Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.