|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.cache.DataContainer
public class DataContainer
A container for the root node in the cache, which also provides helpers for efficiently accessing nodes, walking trees, etc.
Constructor Summary | |
---|---|
DataContainer()
|
Method Summary | |
---|---|
List<NodeData> |
buildNodeData(List<NodeData> list,
NodeSPI node)
Prepares a list of NodeData objects for a specified node and all its children. |
Object[] |
createNodes(Fqn fqn)
Traverses the tree to the given Fqn, creating nodes if needed. |
void |
createNodesLocally(Fqn<?> fqn,
Map<?,?> data)
|
boolean |
evict(Fqn fqn)
|
void |
evict(Fqn fqn,
boolean recursive)
|
boolean |
exists(Fqn fqn)
Tests if an Fqn exists and is valid and not deleted. |
Set<Fqn> |
getInternalFqns()
Returns a Set |
List<Fqn> |
getNodesForEviction(Fqn fqn,
boolean recursive)
Generates a list of nodes for eviction. |
int |
getNumberOfAttributes()
Returns an approximation of the total number of attributes in the cache. |
int |
getNumberOfAttributes(Fqn fqn)
Returns an approximation of the total number of attributes in this sub cache. |
int |
getNumberOfLocksHeld()
Returns the number of read or write locks held across the entire cache. |
int |
getNumberOfNodes()
Returns an approximation of the total number of nodes in the cache. |
NodeSPI |
getRoot()
Retrieves the root node. |
boolean |
hasChildren(Fqn fqn)
Returns true if the Fqn exists, is valid and is not deleted, and the node has children. |
void |
injectDependencies(Configuration configuration)
|
NodeSPI |
peek(Fqn fqn)
Finds a node given a fully qualified name, directly off the interceptor chain. |
NodeSPI |
peek(Fqn<?> fqn,
boolean includeDeletedNodes)
Same as calling peek(fqn, includeDeletedNodes, false). |
NodeSPI |
peek(Fqn<?> fqn,
boolean includeDeletedNodes,
boolean includeInvalidNodes)
Peeks for a specified node. |
NodeSPI |
peek(Fqn fqn,
DataVersion version)
Finds a node given a fully qualified name and DataVersion. |
NodeSPI |
peek(Fqn fqn,
DataVersion version,
boolean includeInvalidNodes)
Searches for a specific node, with a specific data version and, optionally, invalid nodes as well, but not deleted nodes. |
NodeSPI |
peekStrict(GlobalTransaction gtx,
Fqn fqn,
boolean includeInvalid)
Similar to peek(Fqn, org.jboss.cache.optimistic.DataVersion) except that it throws a NodeNotExistsException
if the node cannot be found. |
String |
printDetails()
Prints information about the contents of the nodes in the cache's current in-memory state. |
String |
printLockInfo()
Returns lock information. |
void |
registerInternalFqn(Fqn fqn)
Adds the specified Fqn to the list of Fqns to be considered "internal". |
protected void |
removeData(Fqn fqn)
|
boolean |
removeFromDataStructure(Fqn f,
boolean skipMarkerCheck)
Removes the actual node from the tree data structure. |
void |
setRoot(NodeSPI root)
Sets the root node reference to the node passed in. |
String |
toString()
|
String |
toString(boolean details)
Returns a debug string with optional details of contents. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DataContainer()
Method Detail |
---|
public void injectDependencies(Configuration configuration)
public NodeSPI getRoot()
public void setRoot(NodeSPI root)
root
- nodepublic void registerInternalFqn(Fqn fqn)
fqn
- fqn to add to listpublic NodeSPI peek(Fqn fqn)
fqn
- Fully qualified name for the corresponding node.
public NodeSPI peek(Fqn fqn, DataVersion version)
fqn
- fqn to findversion
- version of the node to find
public NodeSPI peekStrict(GlobalTransaction gtx, Fqn fqn, boolean includeInvalid)
peek(Fqn, org.jboss.cache.optimistic.DataVersion)
except that it throws a NodeNotExistsException
if the node cannot be found.
gtx
- global transactionfqn
- fqn to findincludeInvalid
- if true, invalid nodes are considered as well.
public NodeSPI peek(Fqn fqn, DataVersion version, boolean includeInvalidNodes)
fqn
- Fqn to findversion
- version of the node to findincludeInvalidNodes
- if true, invalid nodes are considered
public NodeSPI peek(Fqn<?> fqn, boolean includeDeletedNodes)
fqn
- Fqn to findincludeDeletedNodes
- if true, deleted nodes are considered
public NodeSPI peek(Fqn<?> fqn, boolean includeDeletedNodes, boolean includeInvalidNodes)
fqn
- Fqn of the node to findincludeDeletedNodes
- if true, deleted nodes are also consideredincludeInvalidNodes
- if true, invalid nodes are also considered
public boolean exists(Fqn fqn)
fqn
- the fqn representing the node to test
public boolean hasChildren(Fqn fqn)
fqn
- the fqn to test
public List<NodeData> buildNodeData(List<NodeData> list, NodeSPI node)
NodeData
objects for a specified node and all its children.
list
- List of NodeData objects, which will be added to.node
- node to recursively add to the list
public List<Fqn> getNodesForEviction(Fqn fqn, boolean recursive)
Node.setResident(boolean)
.
fqn
- the node to consider for evictionrecursive
- if recursive, child nodes are also considered
public String toString()
toString
in class Object
public Set<Fqn> getInternalFqns()
BuddyManager.BUDDY_BACKUP_SUBTREE
if buddy replication is
enabled.
null
.public String toString(boolean details)
public int getNumberOfLocksHeld()
public int getNumberOfNodes()
public String printDetails()
public String printLockInfo()
public int getNumberOfAttributes(Fqn fqn)
getNumberOfAttributes(org.jboss.cache.Fqn)
public int getNumberOfAttributes()
public boolean removeFromDataStructure(Fqn f, boolean skipMarkerCheck)
f
- the Fqn of the node to removeskipMarkerCheck
- if true, skips checking the boolean NodeSPI.isDeleted()
flag and deletes the node anyway.
public void evict(Fqn fqn, boolean recursive)
public boolean evict(Fqn fqn)
protected void removeData(Fqn fqn)
public Object[] createNodes(Fqn fqn)
Object[] results = createNode(myFqn);
results[0] // this is a List<NodeSPI> of nodes created in getting to the target node.
results[1] // is a NodeSPI reference to the target node, regardless of whether it was created or just found.
fqn
- fqn to find
public void createNodesLocally(Fqn<?> fqn, Map<?,?> data) throws CacheException
CacheException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |