org.neodatis.odb.impl.core.btree
Class LazyODBBTreePersister
- java.lang.Object
-
- org.neodatis.odb.impl.core.btree.LazyODBBTreePersister
-
- All Implemented Interfaces:
- IBTreePersister, ICommitListener
public class LazyODBBTreePersister extends java.lang.Object implements IBTreePersister, ICommitListener
Class that persists the BTree and its node into the NeoDatis ODB Database.
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringLOG_IDstatic intnbLoadNodesstatic intnbLoadNodesFromCachestatic intnbLoadTreestatic intnbSaveNodesstatic intnbSaveNodesInCachestatic intnbSaveTree
-
Constructor Summary
Constructors Constructor and Description LazyODBBTreePersister(IStorageEngine engine)LazyODBBTreePersister(ODB odb)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidafterCommit()voidbeforeCommit()voidclear()voidclearModified()voidclose()static java.lang.StringBuffercounters()java.lang.ObjectdeleteNode(IBTreeNode o)voidflush()OIDgetNextNodeId()IBTreeloadBTree(java.lang.Object id)IBTreeNodeloadNodeById(java.lang.Object id)Loads a node from its id.voidpersist()static voidresetCounters()OIDsaveBTree(IBTree treeToSave)java.lang.ObjectsaveNode(IBTreeNode node)saves the bree node Only puts the current node in an 'modified Node' map to be saved on commitvoidsetBTree(IBTree tree)
-
-
-
Field Detail
-
LOG_ID
public static final java.lang.String LOG_ID
- See Also:
- Constant Field Values
-
nbSaveNodes
public static int nbSaveNodes
-
nbSaveNodesInCache
public static int nbSaveNodesInCache
-
nbSaveTree
public static int nbSaveTree
-
nbLoadNodes
public static int nbLoadNodes
-
nbLoadTree
public static int nbLoadTree
-
nbLoadNodesFromCache
public static int nbLoadNodesFromCache
-
-
Constructor Detail
-
LazyODBBTreePersister
public LazyODBBTreePersister(ODB odb)
-
LazyODBBTreePersister
public LazyODBBTreePersister(IStorageEngine engine)
-
-
Method Detail
-
loadNodeById
public IBTreeNode loadNodeById(java.lang.Object id)
Loads a node from its id. Tries to get if from memory, if not present then loads it from odb storage- Specified by:
loadNodeByIdin interfaceIBTreePersister- Parameters:
id- The id of the nod- Returns:
- The node with the specific id
-
saveNode
public java.lang.Object saveNode(IBTreeNode node)
saves the bree node Only puts the current node in an 'modified Node' map to be saved on commit- Specified by:
saveNodein interfaceIBTreePersister
-
close
public void close() throws java.lang.Exception- Specified by:
closein interfaceIBTreePersister- Throws:
java.lang.Exception
-
loadBTree
public IBTree loadBTree(java.lang.Object id)
- Specified by:
loadBTreein interfaceIBTreePersister
-
saveBTree
public OID saveBTree(IBTree treeToSave)
- Specified by:
saveBTreein interfaceIBTreePersister
-
getNextNodeId
public OID getNextNodeId() throws java.io.IOException
- Throws:
java.io.IOException
-
persist
public void persist()
-
afterCommit
public void afterCommit()
- Specified by:
afterCommitin interfaceICommitListener
-
beforeCommit
public void beforeCommit()
- Specified by:
beforeCommitin interfaceICommitListener
-
deleteNode
public java.lang.Object deleteNode(IBTreeNode o)
- Specified by:
deleteNodein interfaceIBTreePersister
-
setBTree
public void setBTree(IBTree tree)
- Specified by:
setBTreein interfaceIBTreePersister
-
resetCounters
public static void resetCounters()
-
counters
public static java.lang.StringBuffer counters()
-
clear
public void clear()
- Specified by:
clearin interfaceIBTreePersister
-
clearModified
public void clearModified()
-
flush
public void flush()
- Specified by:
flushin interfaceIBTreePersister
-
-
DataMelt 3.0 © DataMelt by jWork.ORG